Global name 'day' is not defined


#1



https://www.codecademy.com/courses/python-beginner-P5YtY/1/3?curriculum_id=4f89dab3d788890003000096#


I believe my code is as instructed. It also matches the successful code from various forum posts but is still running into an error.
When my input is set to (days) I get the following error:

When I change it to (day) I get:

If I try to include both inputs (days, day) I fail the single input check:


Why is it (days) failing if that is what was instructed? Where am I going wrong?
Any advice or suggestions are much appreciated!


def hotel_cost(nights):
    return 140 * nights
    
def plane_ride_cost(city):
    if city == "Charlotte":
        return 183
    elif city == "Tampa":
        return 220
    elif city == "Pittsburgh":
        return 222
    elif city == "Los Angeles":
        return 475

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


#2

Hi @moshe_thebau5,

In the code that you posted, this line in the rental_car_cost function ...

    elif day >= 3:

... should be changed to this ...

    elif days >= 3:

#3

THANK YOU!!! I read through the code so many times but still managed to miss that.


#4