【发布时间】:2017-08-13 00:21:48
【问题描述】:
我在运行 Python 3.5.0 的 Windows 8 中遇到流程图问题 当我运行程序时没有错误消息,但是当我键入 No 时,程序执行输入为是,你可以帮我解决这个问题。
print('Hello, do you want to play a game')
print('Great lets play a guessing game')
print('Think of an animal and I will ask you')
print('different questions to try to guess your animal')
print('Press Y for yes and N for no')
fly = input('Question #1 Can your animal fly?')
if fly == 'Y':
print('You have chosen no')
bird = input('Question #2 Is your animal a bird?')
if bird == 'Y':
print('Yay I win')
elif fly == 'N':
print('Question #2 Can your animal swim?')
elif bird == 'N':
print('Does your animal live on land')
【问题讨论】: