我试图在这个游戏中保持分数,所以我设置了一个分数变量,每次正确回答答案时,它会增加 + 1 分,如果你得到不正确的答案,它会扣除一分。当我最后打印分数时,它仍然等于 0。
score = 0
q1answer = ("metallica", "slayer", "megadeth", "anthrax")
answerinput = str(input("name one of the 'Big Four' metal bands'"))
if answerinput.lower() in q1answer:
print ("You got the right answer!")
score + 1
else:
print ("That is the wrong answer...")
score - 1
print (score)