Whats wrong with my code?


#1



Replace this line with your code. 

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
        
plane_ride_cost("Tampa")  

def rental_car_cost(days):
    cost = 40*days

    if days>=7:
        cost -= 50

    elif days >=3:
        cost -= 20

return cost

def sum(): 
    return plane_ride_cost(city)+rental_car_cost(days)+hotel_cost(days)


#2

Hi,

check the indentation of the return statement in rental_car_cost.


#3

Your return statement in the rental car function is indented wrong. It should be indented 4 spaces, fix that and you should be good.


#4

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