day2
作者:互联网
#用户登陆(三次机会重试) count = 1 while count <=3: user = input("请输入用户名:") pwd = input("请输入密码") if user =="dufuyong" and pwd == "123456": print("欢迎光临切尔西酒店~!") break else: print("用户名或密码错误,请重新输入") count = count + 1 if count>3: print("对不起,您的输入已经超过3次,请3小时后再来!")
标签:count,对不起,day2,重试,while,print 来源: https://www.cnblogs.com/ningbotianjiao/p/12358174.html