Stuck on 3/7


Replace this line with your code.


What error is it giving you?


what's wrong with my code!


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


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


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


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"


You forgot the colons after your if, elif statements.


_______It worked! Thanks!


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


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