Im having quite a bit of trouble on "6. Hey, you never know!


The instructions tell me to do this to my code.

  1. Modify your trip_cost function definition. Add a third argument, spending_money.
  2. Modify what the trip_cost function does. Add the variable spending_money to the sum that it returns.

Spending_money is never defined in the code, and so I am getting errors like this:

Oops, try again. trip_cost('Pittsburgh', 0, 0) raised an error: 'int' object is not callable

I am very confused as to what is occurring here.I will be very grateful for your help. Here is a copy of the code that gives me and error.

def hotel_cost(nights):
return 140 * (nights)
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
if days >= 7:
seven_discount = cost - 50
return seven_discount
elif days >= 3 and days <= 7:
three_discount = cost - 20
return three_discount
return cost
def trip_cost(city, days, spending_money):
return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city) + spending_money()


Hi to that spending_money() remove the ()


Thanks for your help! I can't believe I missed that!