标签:python 新世界 name 使用 账号密码 code span col 密码
#使用while循环输出1 2 3 4 5 6 8 9 10 count = 1 while count <= 10: if count == 7: count += 1 continue print(count) count += 1 #求1-100的所有数的和 count = 1 sum = 0 while count <= 100: sum += count count = count + 1 print (sum) #求1-100内的所有有奇数 count = 1 while count <= 100: print(count) count = count + 2 #输出1-100内的所有偶数 count = 1 while count <= 100: count += 1 print(count) count += 1 #求1-2+3-4+5...99的所有的数的和 count = 1 sum1 = 1 sum2 = 1 while count < 100: count += 1 sum1 += count count += 1 sum2 += count print(sum2-sum1) #用户登录(三次机会重试) n = 1 for count in {1,2,3,4}: if n < 4: name = input("请输入账号") password = input(‘请输入密码:‘) else: print(‘重试次数超过3次,请稍后再尝试‘) continue if name == ‘mao‘ and password == ‘chun‘: print(‘欢迎进入到新世界‘) break else: print(‘您输错账号密码%s次‘%n) print(‘请重新输入账号和密码‘) n = n + 1
标签:python 新世界 name 使用 账号密码 code span col 密码
原文地址:https://www.cnblogs.com/miaoxiansheng/p/9526071.html