我正在尝试用 python 创建一个游戏,一个名为“谁想成为百万富翁?”的多项选择游戏。问题是一旦用户未能回答第一个问题,我希望程序停止执行第二个问题。
print("What is the tallest being in existence?")
input(("If you want to see the choices just press enter. " + name))
print("Is it A, Dinosaur?")
print("B, The one and only, Giraffe")
print("C,The soul of the ocean Whale")
print("or D, None")
print("So what do you believe is the answer ? " + name + " ")
answer_1 = input()
if answer_1 == Q1_answer:
print("Correct! You Have Earned 100,000$ ")
score = +100000
if answer_1 != Q1_answer:
print("Im sorry, You have lost the game.")
print("Which famous inventor was born in 1856?")
print("A Einstein")
print("B, Tesla")
print("C, Napoleon")
print("D, Newton")
answer_2 = input()
if answer_2 == Q2_answer.lower():
print("Correct! It is Tesla Indeed, Your reached 200,000$ ")
score = +100000
else:
print("Sorry, wrong answer. You have lost and earned 0$. ")
紫衣仙女
MM们
白板的微信
相关分类