Stuck on 3/7


#1



Replace this line with your code.


#2

What error is it giving you?


#3

what's wrong with my code!


#4

It doesn't look like you code got posted. Could you try posting it again?


#5

def hotel_cost(nights):
return 140 * nights
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


#6

I also put the four spaces on all of the returns and the ifs and elifs


#7

Remeber when you have an if statement you need a ":" after the conditional statement, this applies to elif and else as well.

As an example here is the code from the lesson:

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

#8

You forgot the colons after your if, elif statements.


#9

_______It worked! Thanks!


#10

If that was directed to me, then you're welcome.


#11

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