摘要: i=0 while i<3: username = input('请输入你的用户名:').strip() password = input('请输入你的密码:').strip() if username == '' or password == '': print('用户名输入不能为空') elif username =="xiaozhou" a... 阅读全文
posted @ 2018-11-24 19:09 维也纳729 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 循环:重复执行某段代码。循环也叫遍历、迭代 比如:想给每个人存一个文件夹,循环给每个人添加 for while while 条件成立,则一直循环 方式一: while循环语句 方式二: for循环语句 阅读全文
posted @ 2018-11-24 18:31 维也纳729 阅读(230) 评论(0) 推荐(0) 编辑
摘要: import random num = random.randint(10,20) print(num) for i in range(0,num): print(i) 遍历字符串 a = 'zholi' for i in a: print(i) 遍历数组: a = ['a',34,'bn','哈哈'] for i in a: print(i) 遍历字典所有的key ... 阅读全文
posted @ 2018-11-24 17:14 维也纳729 阅读(120) 评论(0) 推荐(0) 编辑