User input not printing as expected


Oops, try again. It looks like plane_ride_cost does not return 475 when the city is Los Angeles.
The city name should go as Tampa, but it is appending a character "u" before Tampa (same for all other cities too!!). I checked with pycharm the same is not happening, working as expected

Only entered city name should go into method

def hotel_cost(nights):
    cost = 140
    pay = cost * nights
    print pay
    return pay
city = raw_input("Enter the destination city:")
def plane_ride_cost(city):
    print('CITY Name is ::',city)
    if (city == "Charlotte"):
        print 1
        return 183
    elif (city == "Tampa"):
        print 2
        return 220
    elif (city == "Pittsburgh"):
        print 3
        return 222
    elif (city == "LosAngeles"):
        print 4
        return 475
        print "Enter valid destination"
        return "INVALID"


in this part of code:

elif (city == "LosAngeles")

you must use exactly fix with that say codecadmy instructions
in instructions say: "Los Angeles": 475 but you write "LosAngeles" (without space), codecademy engin use Los Angeles but anything not to seem that.

just insert space between Los Angeles.


It worked!!

Thank You


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.