#3 Getting There


#1



The excercise gives me this instruction:
Instructions
Below your existing code, define a function called plane_ride_cost that takes a string, city, as input.
The function should return a different price depending on the location, similar to the code example above. Below are the valid destinations and their corresponding round-trip prices.
"Charlotte": 183
"Tampa": 220
"Pittsburgh": 222
"Los Angeles": 475


The program gives me this answer
"None"
And the error:

Oops, try again. It looks like plane_ride_cost does not return 183 when the city is Charlotte.

I've already tried the returns without strings, but the error is the same


I just expected the code runned


Replace this line with your code. 

My code is:
def plane_ride_cost(city):
    if city == "Charlote":
        return "183"
    elif city == "Tampa":
        return "220" 
    elif city == "Pittsburgh":
        return "222" 
    elif city == "Los Angels":
        return "475" 
    else:
        return "0"


#2

you misspelled Charlotte and you should return integer values, doing math with strings sucks


#3

I ve already done it, but seems ike th same, because it gives me the same error message


#4

Can i see an updated version of your code?


#5

You misspelled Charlotte as well as Los Angeles and the price has should not have quotation marks.


#6

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