我对python很新,我不断收到错误,说“dest_choice未定义”
def flight_choice():
destination_option = input ("Where do you wnat to go?\n[1] Spain\n [2] Paris")
if destination_option == "1":
dest_choice = "Spain"
然后用调用
def ticket_amount():
print("The flight you selected was to" + str(dest_choice) + "Thanks for flying with us"
我很确定我需要使用“全局”或“非本地”,但我可以用
来弄清楚