Taking a vac


#1


can someone pls tell me where i went wrong with this? the error message says the the value for 3 days is NONE.

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


#2

a return keyword is only reached if else runs, a return keyword should always be reached.

either return the cost in the if, elif and else, or after the else.


#3

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