取得値は、ユーザーの値に基づいて、特定のフレーズを出力します
user_input = input("You decide: ")
#functionも(間違った値の必要性ループが入力された)はループ <p>ユーザーが間違った値を入力した場合、最初からやり直すという文をループしようとします。私は立ち往生していて、コンピュータを投げ捨てることに近いですが、私は単純な修正があることを知っていますが、それを見つけることはできません。</p>
if user_input == 'A' or user_input == 'a':
print("With Uncle Sam in your corner you shall not fail...or I could be wrong?\nEither way lets get that Clock rolling")
elif user_input == 'Q' or user_input == 'q':
mess = ("Well to heck with ya then!")
print(mess)
elif user_input == 'B' or user_input == 'b':
print("May Mother Russia led you to a brighter future!\nLets begin shall we")
elif user_input == 'C' or user_input == 'c':
print("Ahhhh..the lonley Red State....well all I can say is either they follow you or get regret ever doubting you!!\nBegin your reign")
else:
print("Wrong Value!!!")
を間違った値のエラーメッセージがある場合
'return'は常に' while'に強制的に1回だけ実行されます...正しい? – NoobEditor
@ NoobEditor、はい、関数からの戻り値はループを終了します。入力が応答辞書のいずれかのキーと一致しない場合、 'try except KeyError'は分岐します。 –