我想在這個遊戲中保持一個分數,所以我設置了一個分數變量,並且每當答案被正確回答時,它就增加1分來得分,如果你得到一個不正確的答案,它會扣除一個分數。當我在結束打印得分,它仍然是等於0評分在這裏不起作用? - Python
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)