4/7 help


#1

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

def rental_car_cost(days):
# discount on the rental car...
dcost==40*days
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


#2

@codegirl8675,
With

dcost==40*days

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

dcost = 40*days

#3

@leonhard.wettengmx.n
thank you so much, that helped big time!


#4

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