Oops, try again. plane_ride_cost('Charlotte') raised an error: unexpected EOF while parsing (<string>, line 0)


#1

Don't quite understand the following error:

Oops, try again.
plane_ride_cost('Charlotte') raised an error: unexpected EOF while parsing (, line 0)

Here is my code, any help would be great :stuck_out_tongue:

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

#2

Try removing the line city = input().
This line is unnecessary because the name of the city is given as the argument for the function.


#3

With city = input() removed, it returns the following error:

Oops, try again.
trip_cost('Charlotte', 2) raised an error: global name 'nights' is not defined


#4

From there I worked out how to do it, thanks!