Getting There


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/learn-python/lessons/taking-a-vacation/exercises/getting-there?action=lesson_resume

<In what way does your code behave incorrectly? Include ALL error messages.>

It looks like plane_ride_cost does not return 183 when the city is Charlotte.

<What do you expect to happen instead?>

I expected it to run smoothly

```python

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

<do not remove the three backticks above>

#2

Hi @aymanbahta, let’s look at this part of your code:

A function ends when the return keyword is reached, and your function ends too early. Look at your code, do you see that return keyword on line 2 of this quote? How do we fix this? How do we get our function to execute its if/elif statements without it ending so early?

Also, make sure your code is indented properly :slight_smile:


#3

wow im so slow lol I didn’t even realize that I had done that, thanks!


#4

Sure, no problem. We all make mistakes like this sometimes :wink:


#5

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