Transportation


#1


Can i get any help? can't figure it out.


#2

You don't need to write days after the number 7. Same after the 3.


#3

Ohh yeah, I just deleted days after numbers. But, it still says line 16, SyntaxError.


#4

Aaaaand you don't need to add the dollar sign.


#5

Current one and still shows error
def rental_car_cost(days):
# costs $40 per day
if days >= 7:
costs += 50
if days >= 3:
costs += 20
else:
return costs


#6

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


#7

The error is clear. Python found a variable called cost in your code, but it doesn't seem to be declared before referencing to it. Declare the variable cost and you're good to go.