我试着使用键盘输入来创建一个假的计算器,但是当我运行的代码我得到:Python 3的打印功能
<function trip_cost at 0x01FF3348>
我的代码是:
city = input("What city will you vacation at?")
days = input("How many days will you be staying there?")
def hotel_cost(days):
return 140 * days
def plane_ride_cost(city):
if city == "Charlotte":
return 183
elif city == "Tampa":
return 220
elif city == "Pittsburgh":
return 222
elif city == "Los Angeles":
return 475
def rental_car_cost(days):
cost = 40 * days
return cost
def trip_cost(city, days):
return plane_ride_cost(city) + rental_car_cost(days) + hotel_cost(days)
print (trip_cost)
我怎样才能得到它要退还它将花费的金额?
感谢
好的,谢谢 – OceanS
@OceanS如果这回答了你的问题,请点击箭头下方的勾号来接受它。 – EpsilonX