Taking a vacation 5 pull it together


#1

when ever i run this code i get the error

Oops, try again. plane_ride_cost('Tampa') returned None instead of the correct value 220

please help i am so stuck!!!!

def hotel_cost(nights):
return 140 * nights

def plane_ride_cost(city):
if city == "Charlotte":
return 183
elif city == "los Angeles":
return 475
elif city == 'pittsburgh':
return 222
def rental_car_cost(days):
n = 40
if days >= 7:
return (days*n-50)
elif days >=3:
return (days*n-20)
else:
return (days*n)

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


#2

It says your code fails on tampa, have you written code to handle that?


#3

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