Hey, You never know


<I can’t see it , it’s probably right in front of me>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>
trip_cost(‘Charlotte’, 8, 0) returned 3773 instead of the correct value 1573

<What do you expect to happen instead?>


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 = days*40
if days >= 7:
return cost-50
elif days >=3:
return cost-20
else :
return cost

def trip_cost(city,days,spending_money):
spending_money = 2200
return hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days) + spending_money
print trip_cost


Why are you setting spending_money to 2200? spending_money is passed in as a parameter, get rid of that line


Thanks bud , can’t believe that went by me


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.