Getting there... What am I doing wrong?


#1



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

Error code: Oops, try again. Did you create a function called plane_ride_cost?


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


So, What am I doing wrong? I thought I did define plane_ride_cost.


#2

Something must have interrupted the lesson checker so it only sent the best error message it had. There must be a console error message; is there one?


#3

Ha! Figured it out. I was so confused by the "Oops" error I didn't realize I forgot the colons after the "if" and "elif" statements.

I'm a n00b...

Anyway, thanks for your help! You pointed me in the right direction.


#4

Also, make sure you have an else statement at the end...just in case!


#5

Not required in this exercise, but you raise a good point. In a production sense there should always be a default return value in absence of matchable inputs.


#8