7.06 You Never Know!


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

7.6 Hey You Never Know!

Hello to all who can help me before you say anything yes I’m a n00b. Anyway I keep getting this error message: trip_cost(‘Los Angeles’, 0, 0) returned <function trip_cost at 0x7f750a3ac848> instead of the correct value 475. Any advice?

please not this may not be the final version and I have tried multiple times with different configurations. Thanks! ^U^

```python

ef 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):
return cost - 50
elif(days >= 3):
return cost - 20
else:
return cost

def trip_cost(city, days, spending_money):
hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days) + spending_money
return trip_cost
print trip_cost (“Tampa”, 600, 5)

<do not remove the three backticks above>

#2

HI this part


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

instead of returning the function trip_cost you should return hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days) + spending_money and remove the return trip_cost

and this line

print trip_cost ("Tampa", 600, 5)

You don’t need to indent it.


#3

Danke Schon (thank you!!!)