Python Glitch - Preventing from Moving Forward in my "Relaxing Vacation"


#1



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


When I go to hit Save & Submit, the error box pops up with "Oops, try again. It looks like plane_ride_cost does not return 183 when the city is Charlotte"


I have gone through other forums and looked at similar codes, but mine keeps returning this error message, and will sometimes return with a similar error message "....does not return 220 when the city is Tampa". could someone please help me with this or tell me how I will be able to go around this while still completing the full lesson?


def hotel_cost(nights):
    return 140* nights

def plane_ride_cost(city):
    if "Charlotte":
        return "The price is 183"
    elif "Tampa":
        return "The price is 220"
    elif "Pittsburgh":
        return "The price is 222"
    elif "Los Angeles":
        return "The price is 475"


#2

you should return integer values, not strings. How else are you going to calculate the cost of the city + hotel?


#3

would that look something along the lines of

if city == "Tampa":
return int(220)

or am i to be adding together the cost of the city + the flight?

i'm still fumbling through this section of code, so any advice you can give really helps - thank you


#4

220 is a integer, why also cast it to an integer?

this was just telling you what you are going to do later (calculating the cost of the entire trip), and having a string is then not very practical


#5

figured it out! thank you!


#6