4/7 Transportation


#1



https://www.codecademy.com/courses/python-beginner-P5YtY/1/3?curriculum_id=4f89dab3d788890003000096

Oops, try again. Did you create a function called rental_car_cost?

I've changed the function name several times and can't seem to get it work. The indentation seems weird. The hotel cost and plane ride cost are apparently right but trying to copy that same format for the rental car creates an indentation error. I've tried adjusting the previous code and new code and it gives me an error no matter what.


def hotel_cost(nights):
    return 140*nights 
def plane_ride_cost (city):
 if city== "Charlotte":
    return 183
 if city=="Tampa":
    return 220
 if city== "Pittsburgh":
    return 222
 if city=="Los Angeles": 
    return 475
 def rental_car_cost(days):
    costs= days*4
 if days >= 7:
     costs-=50
 elif days >= 3:
     costs-=20
 return costs


#2

you need to multiply days with 40 not 4


#3

Yea, thanks it's not what the issue was but, after playing with the indentation some more I got it to work.