17/03/17 19:41:57.57 dpI1G6OF.net
>>838
俺ならこうかな
foods = ['和食', '洋食', '中華']
def choiceInput(prompt, choices):
while True:
print(prompt)
choice = input('>')
if choice in choices:
return choice
print('入力エラー')
def order():
while True:
print('和食, 洋食, 中華')
choice = choiceInput('どれを食べますか (0/1/2)', ['0','1','2'])
yesNo = choiceInput(f'{foods[choice]}で本当にいいですか(Y/N)', ['Y', 'y', 'N','n'])
if yesNo in ['Y', 'y']:
return choice