2017-08-13 73 views
0

我有一個流程圖問題。在Windows 8上運行的Python 3.5.0 當我運行的程序沒有錯誤消息,但是當我鍵入這個程序沒有執行輸入的是你能幫我解決這個問題嗎?流程圖運行的Python 3.5.0

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') 

回答

0

答案是非常簡單的,你寫

if fly == 'Y': 
    print('You have chosen no') 

顯然你的意思

if fly == 'N': 
    print('You have chosen no') 

要找到這種錯字不要猶豫,加入print語句在你的代碼,或大聲解釋你的代碼,一些橡皮鴨子,它確實有助於!