elif choice == "2":
name = input("What is your name? ")
score = int(input("What score did you get? ")
entry = (score, name)
scores.append(entry)
scores.sort(reverse=True)
scores = scores[:10]
为什么entry = (score, name)
出现在Invalid syntax error
?
答案 0 :(得分:2)
你错过了关闭paren:
int(input("What score did you get? ")) # <- missing a closing paren
答案 1 :(得分:2)
您忘记了)
末尾的score = int(input("What score did you get? ")
。它应该是score = int(input("What score did you get? "))