Python要练习的东西
明天要练习和要掌握的东西
username = 'xiaoming' password = '123' i = 0 while i < 3: name = input('请输入你的用户名:') pwd = input('请输入密码:') if username == name and password == pwd: print('你登录成功!') break else: print('登录失败,你还有%d次登录机会' %(2-i)) if 2-i == 0: result = input('是否还想再试试?Yes') if result == 'Yes': i = 0 continue i += 1 else: print('你没有机会了!')