8. Taking a Vacation - 4. Transportation


#1


"Oops, try again. It looks like rental_car_cost returns 120 instead of the correct amount (100) for 3 days."
This is the messege that i get form the console.


def hotel_cost (nights):
    return 140 * 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
        
def rental_car_cost (days):
    total=(days * 40)
    return total
    if days >=7:
        return days * 40 - 50
    elif days >=3:
        return days * 40 - 20
    else:
        return 'Error'


#3

def rental_car_cost(days):
cost = 40 * days
if days >= 7:
return cost - 50
elif days >= 3:
return cost - 20

return cost

#4

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