【发布时间】:2015-03-28 01:00:41
【问题描述】:
我是一名新手程序员,正在尝试编写一个程序,在该程序中我要求用户提供特定的输入,例如奥巴马、克林顿或布什,并在他们给出正确答案时祝贺他们,或者在他们给出错误答案时通知他们。
我很确定我犯了一个非常简单和愚蠢的错误,所以如果有人能帮助我,我将不胜感激。
def main ():
pres = input ('Please enter the surname of a recent President of the United States: ')
if pres == 'Bush' or 'Obama' or 'Clinton':
print('Great job! You know your stuff!')
else:
print('Sorry, that was incorrect.')
main()
谢谢!
【问题讨论】:
-
恕我直言,不是重复的。
标签: python python-3.x