When I put return statement, that returns the value of the variable "cost" in the and of the function it gives me syntax error.
I've put return statements after the each if and elif blocks. I think the code block below should work correctly. Unlike my assumptions, it works incorrectly. As long as I put it in the end of the function, it works... But I think, in my method, the case which i put return statements after the each if and elif, it should work!
Replace this line with your code.
type or paste code here
def rental_car_cost(days): cost = 40 * days if days >= 7: cost -= 50 return cost elif days >= 3: cost -= 20 return cost