Skip to content

Instantly share code, notes, and snippets.

Created March 11, 2017 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/89aee831d0f744e2c7a97f41489d4174 to your computer and use it in GitHub Desktop.
Save anonymous/89aee831d0f744e2c7a97f41489d4174 to your computer and use it in GitHub Desktop.
food = ["和食","洋食","中華"]
depth = 0
hots = []
while True:
if depth == 0:
print(food)
print("どれを食べますか (0/1/2)")
choice = input(">")
for n in range(len(food)):
hots.append(str(n))
if choice in hots:
depth += 1
continue
else:print("入力エラー")
if depth == 1:
print(food[int(choice)],"で本当にいいですか (Y/N)")
yesno = input(">")
if yesno in ["y","Y"]:
depth += 1
continue
elif yesno in ["n","N"]:
depth = 0
continue
else:print("入力エラー")
if depth == 2:
print(food[int(choice)]+"を注文します...")
break
print("完了")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment