The instructions tell me to do this to my code.
- Modify your trip_cost function definition. Add a third argument, spending_money.
- 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.
return 140 * (nights)
if city == "Charlotte":
elif city == "Tampa":
elif city == "Pittsburgh":
elif city == "Los Angeles":
cost = 40*days
if days >= 7:
seven_discount = cost - 50
elif days >= 3 and days <= 7:
three_discount = cost - 20
def trip_cost(city, days, spending_money):
return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city) + spending_money()