0
我基本上是在Python switch語句的嘗試。無法讓這個循環工作。每次只打印一樣的東西。python madlib while循環問題
choice = input("Do you want to play a game? (y) or (n)")
while choice == "y":
while True:
print("1. Fun story")
print("2. Super Fun story")
print("3. Kinda Fun story")
print("4. Awesome Fun story")
print("5. Some Fun story")
choice2 = int(input("Which template of madlib would you like to play(Enter the number of your choice"))
if choice2 == 1:
noun1 = input("Enter a noun: ")
plural_noun = input("Enter a plural noun: ")
noun2 = input("Enter another noun: ")
print("Be kind to your {}-footed {}, or a duck may be somebody’s {}".format(noun1, plural_noun, noun2))
else:
print("Goodbye")
請修復您的縮進。 –