User input not printing as expected


#1


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

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
hotel_cost(10)
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
    else:
        print "Enter valid destination"
        return "INVALID"
plane_ride_cost(city)


#2

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.


#3

It worked!!

Thank You


#4

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