I need help asap


#1

This is my code:

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

And this is the error message:

  File "python", line 1
    hotel_cost(nights):
                      ^
SyntaxError: invalid syntax

#2

Had the same thing, here is youre code:
city_prices = {
"Charlotte": 183,
"Pittsburgh": 222,
"Tampa": 220,
"Los Angeles": 475
}

def hotel_cost(nights):
return 140 * nights

def plane_ride_cost(city):
return city_prices[city]

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

def trip_cost(city, days):
return hotel_cost(days) + rental_car_cost(days) + \
plane_ride_cost(city)


#3

you forgot to define function hotel_cost

def hotel_cost(nights):
    return 140 * nights