I am getting a fatal error on taking a vacation lesson


#1

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

This is my code. I believe the line that is causing the problem is: cost == days * 40 - 50

It says to refresh my page or to reopen it. And yes, I have done it.


#2

Hi, use "=" to assign and "==" to compare values.

Also your function is lacking a return statement. I don't know why this causes a crash though.


#3

Hi here

cost = 40 * days – 20

After days you put instead of -


#4

Ok, Thanks that worked :slightly_smiling: