Question about Transportation


I figured it out, but I had a code before I switched my approach and I can't figure out why it didn't work. An error gets thrown saying my code returns None.

It should result in exactly the same thing, should it not?

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


Remember to return the undiscounted amount at the very end of your function.

return total


Thanks. I was thinking of it as only the if statement and that everything would be covered, I forgot that that they only applied to discounts and so I needed the original total.


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