Python问题求解决

Python字典章节,可能是用一个for进行循环嵌套,但就是运行不出来。

img

dic = {'User1':'123456', 'User2':'111111'}

count = 3

while count>0:
    user,pwd = input('请输入用户名和密码(用空格分开):').split()

    if user in dic and pwd == dic[user]:
        break
    elif user in dic and pwd != dic[user]:
        print('密码错误')
        count -= 1
    else:
        print('输入错误,请重新输入')
        count -= 1

if count>0:
    print('登录成功')
else:
    print('登录失败')

你写的程序是怎样的?把代码贴出来。