python中if语句中的值错误。要取消处理的值太多

2024-04-26 02:58:34 发布

您现在位置:Python中文网/ 问答频道 /正文

  File "game.py", line 81, in <module>
  File "game.py", line 33, in start
    if a == "User name or Password is incorrect!":
ValueError: too many values to unpack (expected 2)

以下是生成错误的代码:

choice = input("> ")
    if choice == "1":
        clear()
        User=input("User Name: ")
        Password=input("Password: ")
        a, b=login(User, Password)
        if a == "User name or Password is incorrect!":
            print("User name or Password is incorrect!")

Here就是那个文件

Here是完整的代码

抱歉,它真的很长,我写了一个很长的代码,并得到了这个错误


Tags: or代码nameinpygameinputif