1 ''' 2 需求:编写登陆接口 3 三次机会 4 ''' 5 username = 'shanyu' 6 password = 'yulai' 7 count = 0 8 while count<3: 9 u = input('请输入用户名') 10 p = input('请输入密码') 11 if u == username and p == password: 12 print('山雨欲来风满楼') 13 break 14 else: 15 print('用户输入错误,您还有{}次机会'.format(2-count)) 16 count += 1 17 else: 18 print('byebye了您内!!!')
登陆验证
猜你喜欢
转载自www.cnblogs.com/Mr-Feng/p/10791650.html
今日推荐
周排行