- 856 名前:デフォルトの名無しさん mailto:sage [2017/03/17(金) 20:42:07.88 ID:SRILy9AU.net]
- 無限ループでwhile Trueを書いていいのはゲームプログラミングぐらいです
このように書くべきです def choiceInput(prompt, choices): print(prompt) choice = input('>') while choice not in choices: print('入力エラー') print(prompt) choice = input('>') whileの横に条件式を書くことで第三者が見てもわかりやすいリーダブルコードになります
|

|