我的问题示例:
food_choice=input("Would you like to eat a burrito or a pizza? ")
if food_choice=='burrito':
print('You should go to a Mexican restaurant!')
if food_choice=='pizza':
print('You should go to an Italian restaurant!')
print('Don't forget to save me a slice of pizza!') #<----- How do I print this at the bottom?
print('Everyone loves to eat!')
print('Have a good time at your restaurant!')
答案 0 :(得分:1)
这是解决此问题的简单方法。
after = ""
food_choice=input("Would you like to eat a burrito or a pizza? ")
if food_choice=='burrito':
print('You should go to a Mexican restaurant!')
if food_choice=='pizza':
print('You should go to an Italian restaurant!')
after = 'Don't forget to save me a slice of pizza!'
print('Everyone loves to eat!')
print('Have a good time at your restaurant!')
if after:
print(after)