4.) Transportation Equations Not Getting The Right Numbers


#1

So once again I am stumped probably by some typing error but I keep getting the Oops, try again. It looks like rental_car_cost returns 120 instead of the correct amount (100) for 3 days. The only thing I could think of was that the minus sign is not right...

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


#2

This is the only line to execute.

cost = days * 40
if days >= 7:
    cost -= 50
elif days >= 3:
    cost -= 20
return cost

#3

I am sorry. Can you explain a little more lol Its probably simple and right in front of my nose xD


#4

Ah thank you! I was wondering if I needed to add cost or if I could simply return everything thanks!


#5

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