【发布时间】:2021-05-10 02:31:11
【问题描述】:
if、elif 和 else 无法正确处理我的输入。我正在努力做到这一点,所以你必须通过所有三个问题才能进入我的假俱乐部。但问题是,如果您错误地回答了前两个问题而正确回答了第三个问题,您仍然可以进入俱乐部。另外,这是学校的作业,我的老师说我错过了一个标题,我的 if 语句不包含实际淘汰或接受潜在用户的逻辑语句。请帮忙。
def main():
age = input("are you younger than 21?")
game = input("what is the game of the day?")
cool = input("what do you think about school?")
print("Welcome to Kidz Only.")
print("are you cool enough to enter?")
if( age == "yes"):
print("question one is done.")
if ( game == "super mario bros"):
print("question two is through.")
if ( cool == "i have mixed feelings"):
print("question three is complete.")
print("You have passed the quiz. Welcome to Kidz Only!")
else:
print("Sorry, but you may not enter Kidz Only.")
main()
【问题讨论】:
标签: python if-statement input