4/7 Transportation


#1


I don't know what's wrong. I've tried everything and looked at all the posts I could, but it still says that the code returns none instead of the correct amount(100) for 3 days.

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


#2

Hint: You forgot to return anything in the if and elif branches.

Remember that only one of the if, elif and else branches is executed. If the if condition is satisfied, the elif or else branches do not execute.


#3

Try removing the "and days < 7:" and the "else", that should do it.
You don't need the "< 7" due to the first if statement and the "else" isn't needed because the statement should return regardless.


#4

If finally let me through.


#5

13 posts were split to a new topic: Did you create a function called rental_car_cost?