2017-08-13 2 views
0

Windows 8でPython 3.5.0を実行しているときにフローチャートが表示される プログラムを実行するとエラーメッセージは表示されませんが、入力しないとプログラムは入力を「はいこの問題を解決するのに役立つかもしれません。Windows 8で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') 
明らか

を書かれているあなたは、タイプミスのこの種は、あなたのコード内でprint文を追加することを躊躇しないで検索するに

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

を意味あなたのコードをいくつかのラバーダンクに説明するために、それは本当に役立ちます!

関連する問題