4/7 Need Help


#1



www.codecademy.com/courses/python-beginner-P5YtY/1/3

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


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


#2

This is a comparison, not a definition. Write __ = ___.


#3

Thank you! I totally confused.


#4

This part is not needed since the condition above covers that interval.

Do you see the difference between an assignment and a comparison?


#5

Right!
Do you have some resource recommended to keep studying after finishing this course?


#6

I usually turn to the python docs and tutorials.

For sure you will do well to have a local environment to develop in. But if all you need for now is a sandbox, there are a few out there. This ons seems to be growing in popularity: repl.it


#7

Yes, it is! thank you again!