# 可以支持多个用户登录 (提示,通过列表存多个账户信息)
uname = [‘wps‘, ‘opp‘ ] pword = [‘123‘,‘1234‘] time = 0 while time < 3: u_name = input("用户名:") if u_name in uname: p_word = input("密码:") if p_word == pword[uname.index(u_name)]: print("ook") break else: print("nno") time += 1 if time ==3: print("错误三次") if u_name in uname: del uname[uname.index(u_name)] break
原文地址:https://www.cnblogs.com/wpss/p/8799284.html
时间: 2024-10-03 11:26:27