7. plan your trip


#1

I’m getting the same error despite have return values for all of my variables:

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

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

print trip_cost(“Loa Angeles”, 7, 350)


7. Plan your trip
#2

Loa Angeles is not a valid destination, as such, plane_ride_cost returns None (the default)


#3

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