python学习1-1

# 可以支持多个用户登录 (提示,通过列表存多个账户信息)

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

 

posted @ 2018-04-11 22:55  红星二锅头  阅读(129)  评论(0编辑  收藏  举报