こんにちは私はコーディングに新しいです、ここで私はユーザーの入力に基づいて簡単なコードを書いています。すべてのifとelifの応答を得ることはできますが、入力が整数でない場合はプログラムが失敗します。Python 3.1私のコードの "Else:"の問題
def tables_bussed():
tables = input("How many tables can you bus per hour? (I can only read numbers.)")
if int(tables) > 80:
print ("That\'s rediculous, you lying twit.")
tables_bussed()
elif int(tables) > 60:
print ("If what you are saying is true then you have quite a talent!")
elif int(tables) > 30:
print ("Impressive! Yet there\'s always room for improvement, now isn\'t there.")
elif int(tables) > 0:
print ("How sad.")
else:
print ("Are you dumb or just daft.")
tables_bussed()
tables_bussed()
私のelse節には何かがありませんか?
正確なエラーは何ですか?あなたの最終的な印刷はインデントされていませんが、コピー貼り付けの問題だと思いますか? – srowland
インデントがありません – Sharad
あなたのインデントがあなたのelseステートメントのように見えません。 – Loufylouf