Created
March 11, 2017 15:58
-
-
Save anonymous/89aee831d0f744e2c7a97f41489d4174 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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