Pull it to gather - help


#1

Hey Guys,

For some reason I have the error below for my code: trip_cost('Tampa', 1) raised an error: global name 'rentel_car_cost' is not defined

My code is:

def hotel_cost(night):
return 140 * night

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):

return plane_ride_cost(city) + hotel_cost(days) + rentel_car_cost(days)

Could you please help me what is wrong with it? :slight_smile:

Thanks!


#2

return plane_ride_cost(city) + hotel_cost(days) + rentel_car_cost(days)

just change one thing from last line of code...
rentel_car_cost(days) to rental_car_cost(days)
(i.e. is You misspelled rental as rentel)

I hope it helps! :slight_smile:


#3

no way:)) Thank you! I would never figure it out:D


#4

Youre welcome!! :slight_smile: :thumbsup:


#5

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