FAQ: Taking a Vacation - Getting There


#1

This community-built FAQ covers the “Getting There” exercise from the lesson “Taking a Vacation”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn Python

FAQs on the exercise Getting There

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!


#2

This might be a dumb question, but when I did my code, I followed the example on the left, and made my code:
if city == “Charlotte”:
return “183”
and so on for all the cities

When I saw the correct answer, it said
if city == “Charlotte”:
return 183

without the quotation marks in the return line.
In the example given for the lesson, they provided quotation marks for the return line, but when it was time for me to do it, they didn’t accept quotations and when they showed me the solution, there was none.

Is this because if it’s numbers in the return line, they don’t require quotations? I’m wondering why the solution doesn’t follow the example provided, or maybe I missed an explanation somewhere.


#3

@chelliepaige I think I figured it out.

The example they gave is returning a string.

The exercise just wants you to return the number not as a string, so it does not need quotation marks.


#4

Why when in the instructions it states " 1. The example above defines the function fruit_color that accepts a string as the argument fruit ." why is fruit defined as an argument and not a parameter?


#5

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
still im getting erron check line 3
File “python”, line 3
** return 183**
** ^**
IndentationError: expected an indented block

i don’t know why.
please send me the clue