Plane rid


Hello Everybody!

I do not understand what’s the matter with this code.

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

It sayes that ther’s a syntax error in line 6 in the elif part. Thank you for your help in advance!

Can you find an error in my code

an elif statement should follow an if statement or another elif statement

your first elif statement (tampa) is nested inside the if clause, while the elif tampa statement should be following/after if statement. You could classify this as indent error


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