📜  如何在 if elif else 语句中使用 while 循环 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:22.638000             🧑  作者: Mango

代码示例1
print("welcome")
while 1 != 2:
 greeting = str(input("Hi, how are you?")
 if greeting == ("bad"):
  print("Don't worry!")
 elif greeting == ("good"):
  print("That's great!")
 else:
  print("Got it.)
# The greeting will continuously loop and letting you answer the question.