摘要: 循环语句 & 继续语句 age = 28counter =0 #自己编辑一个计数器for i in range(10): #循环语句,不能改变 print('-->counter:', counter) #显示计数器的数字的变化 if counter <3: youage = int(input(" 阅读全文
posted @ 2016-11-19 10:45 Daniel.lu 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 循环语句 age = 28for i in range(10): if i < 3: #对i使用if语句 youage = int(input("输入你的年龄")) if youage==age: print("你猜对了") break #break 表示,如果答对了,此循环就结束了 elif yo 阅读全文
posted @ 2016-11-19 10:41 Daniel.lu 阅读(255) 评论(0) 推荐(0) 编辑
摘要: If 语句 user= "吹Sir"passwd= "strong"username = input ("Username:")password = input ("Password:")if username ==user and password==passwd: #<--在这里你可以使用,an 阅读全文
posted @ 2016-11-19 10:37 Daniel.lu 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 导入模块使用import 命令,如调用windows 命令; #os命令,此命令是调用windows命令import osos.system("dir")#用于打印原始输入信息os.popen("dir").read()#查询python目录import sysprint(sys.path)#win 阅读全文
posted @ 2016-11-19 10:33 Daniel.lu 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 这周已经开始Python的学习了,感觉Python类似于Powershell, 但又有不同点。在此总结一下新学到的资料; 简单的使用变量的方法: 阅读全文
posted @ 2016-11-19 10:29 Daniel.lu 阅读(227) 评论(0) 推荐(0) 编辑