[root@VM166136 ~]# cat copy_vmware.sh #!/bin/bash if [ $(id -u) -ne 0 ];then echo "Please use the root user to perform!!!" exit 1 fi #Modify the network card configuration and empty MAC information sed -i '/HWADDR/d' /etc/sysconfig/network-scrip
1.模拟真实环境掷骰子 从Python标准库中调用模块:random——random中包含以各种方式生成随机数的函数 从random中引用randint这一函数——骰子都是有固定面数 from random import randint 很多人学习python,不知道从何学起.很多人学习python,掌握了基本语法过后,不知道在哪里寻找案例上手.很多已经做案例的人,却不知道如何去学习更加高深的知识.那么针对这三类人,我给大家提供一个好的学习平台,免费领取视频教程,电子书籍,以及课程的源代码!QQ
DAY .1 1.使用while循环输出 1 2 3 4 5 6 8 9 10 n = 1 while n < 11: if n == 7: pass else: print(n) n = n + 1 print("------end------") 2.求1-100的所有数的和 n = 1 s = 0 while n < 101: s = s + n n = n + 1 print(s) 3.输出 1-100 内的所有奇数 n = 1 while n < 1