【发布时间】:2025-12-14 14:55:02
【问题描述】:
我在 python 3.4 中编写了一个 BMI 计算器,最后我想问一下用户是否想再次使用该计算器,如果是,请返回代码的开头。到目前为止我已经得到了这个。非常欢迎任何帮助:-)
#Asks if the user would like to use the calculator again
again =input("Thank you again for using this calculator, would you like to try again? Please type y for yes or n for no-")
while(again != "n") and (again != "y"):
again =input("Please type a valid response. Would you like to try again? Please type y for yes or n for no-")
if again == "n" :
print("Thank you, bye!")
elif again == "y" :
....
【问题讨论】:
标签: python loops python-3.x