4/7 help


please help, i cant figure out how to fix my code

def rental_car_cost(days):
# discount on the rental car...
if days >= 7:
dcost -= 50
elif days >=3 and days <7:
dcost -=20
return dcost

it returns none in the window but then this pops up

Oops, try again. An error was raised for rental_car_cost(1): local variable 'dcost' referenced before assignment

whats wrong???? please help




you have used the comparison operator ==
instead of the required assignment operator =

dcost = 40*days


thank you so much, that helped big time!


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