8.6: Hey, You Never Know!


#1



Lesson Here

Whenever I try to input the following code, I get these error messages:
Traceback (most recent call last):
File "python", line 19, in
NameError: name 'spending_money' is not defined


What am I doing wrong here?


def hotel_cost(days):
    return 140 * days
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):
    if days >= 7:
        return (days * 40) - 50
    elif 7 > days >= 3:
        return (days * 40) - 20
    else:
        return days * 40
spending_money == hotel_cost(days) / 140 * 100
def trip_cost(city, days, spending_money):
    return plane_ride_cost(city) + rental_car_cost(days) + hotel_cost(days) + spending_money


#2

HI just remove that line

spending_money == hotel_cost(days) / 140 * 100

#3

Thank you so much! :grin: