Getting There


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

I am trying to figure out what I am missing here for Tampa to return 220.
I am sure it is something easy I missed, but I cannot figure this out.

Replace this line with your code. 
def plan_ride_cost(city):
    if "Charlotte":
        return 183
    elif "Tampa":
        return 220
    elif "Pittsburgh":
        return 222
    elif "Los Angeles":
        return 475


Looks like your forgetting to do what the example shows for this lesson with the parameter in your def. It uses fruit but for you it will be city.

def fruit_color(fruit):
    if fruit == "apple":
        return "red"
    elif fruit == "banana":
        return "yellow"
    elif fruit == "pear":
        return "green"

Compare the two codes and I think what you left out will become obvious


I tried adding this, but I an still recieving the same error.

def hotel_cost(nights):
return (140 * nights)
def plan_ride_cost(city):
if city == "Charlotte":
return 183
elif city == "Tampa":
return 220
elif city == "Pittsburgh":
return 222
elif city == "Los Angeles":
return 475


Ok I will copy and paste your code into my lesson browser and work on it there. Just give me a minute :sunglasses:


Thank you for your help!


Ok so I just got finished pasting your code into my browser and looking for it. Assuming your code is formatted correctly and not as you have pasted it in the lesson your code should work. It is correct so try refreshing your browser or changing internet browsers to see if it will take it then. Sometimes it just bugs out for whatever the reason even though your code is correct.


Perfect, I refreshed the browser and it worked!


Good! Glad it worked out so nicely for ya! Hope the rest of your lessons go even better! :smiley:


The correct syntax is def planE_ride_cost(city): - you were missing an e, you wrote plan_ride_cost(city):


Good catch! Didn't even notice that earlier.


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