Transportation... Can't work it out


#1




interpreter returns 230 but this error appears "
Oops, try again. It looks like rental_car_cost returns 40 instead of the correct amount (80) for 2 days."


def hotel_cost(nights):
    per_night = 140
    return per_night * nights
    
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
    else:
        return "Enter one of the following locations: Charlotte, Tampa, Pittsburgh, or Los Angeles."
        
def rental_car_cost(days):
    rental_car_cost = 40 * days
    if days >= 7:
        cost = rental_car_cost - 50
        return cost
    elif days >= 3:
        cost = rental_car_cost - 20
        return cost
    else:
        return 40
         
print rental_car_cost(7)


#2

What part of this is so difficult for people to get? How do we test this picture?


#3

Sorry, my fault I wanted to show the error message, i'm new in Q&A Forum. Pasted my code. Kindly help me out .


#4

Never mind. Solved it.


#5

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