What's wrong with my code?


#1

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

It keeps saying "Oops, try again. An error was raised for rental_car_cost(1): maximum recursion depth exceeded". What does that even mean?


#2

When you wrote:
car_cost = 40*rental_car_cost(days) you are calling the function inside of itself. Which is something that is possible but not necessary for this course. To fix your error you only need do car_cost=40*days .

When calling a function you are assigning a value to the parameter days making it a variable pretty much. If you did:
rental_car_cost(1) then the value days would have would be one.