FAQ: Learn Python: Syntax - Welcome

This community-built FAQ covers the “Welcome” exercise from the lesson “Learn Python: Syntax”.

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

Computer Science
Data Science

FAQs on the exercise Welcome

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!

3 posts were split to a new topic: Why not just put my name in the string?

A post was split to a new topic: Can I get a Certificate from Learn Python?

A post was merged into an existing topic: “Next” button becomes available even with wrong code?

4 posts were split to a new topic: How can I use an integer in a print function?

A post was merged into an existing topic: Acsii codec? - SOLVED

Someone once told me that using ’ ’ was more “pythonic” and to avoid using " " until we had to. Is that good advice?

what if I want my_name to be in the next line how do I print that in the next line?

Consecutive print statements will appear on consecutive lines.

print ('first line')
print ('second line')

Output

first line
second line

You’ll learn how to print multiple lines in a single print statement a little later on in the Python course. Try not to race ahead, in the meantime. Drill on the basics you are already learning.

1 Like

“Running a program means telling a computer to read the text file, translate it to the set of operations that it understands, and perform those actions.” Can anyone expand on translating a text file to the set of operations that a computer understands? I’m not sure if I’m looking into the statement too much (which is very possible) or if there is more to be elucidated here. Thanks in advance.

1 Like

Python is interpreted and compiled in stages. We go from text to byte code to assembler to machine language. A script is largely interpreted/compiled as it is run, though some of the process is cached so only has to be done once during a session. Let’s first address the question, ‘is python interpreted or compiled?’

Is Python interpreted or compiled? Yes. | Ned Batchelder

2 Likes

Hi. Is python case sensitive?

print("Hello and welcome " +str(my_name) + “!”)

vs.

Print("Hello and welcome " +str(my_name) + “!”)

Above print vs. Print, where Print threw an error:
NameError: name ‘Print’ is not defined

Yes, Python is case sensitive. Only class names are capitalized, all else is lowercase.

1 Like

Thank you, sir!

Might I ask what a “class” is in programming? I took the CodeAcademy: Learn How to Code course (https://www.codecademy.com/learn/learn-how-to-code). Aalthough, I can’t recall it mentioning class.

1 Like

In a general sense it is the definition of a data type or replicable object. It is something that comes up in the courses for many languages. For now best to put this question to the side.

Be sure to start with, and complete the Learn %language% module before attempting anything else in the syllabus.

I am using the same code with slight modifications but it is showing error message…

It is giving result some times but sometimes it is showing as error. The above link is showing as error

File “script.py”, line 1
my_name = “follow me on fb”
^
IndentationError: unexpected indent

You can see the same code I have written on page 1, it is showing correct.

Here is the link

The result is

Hello and welcome Codecademy!
India
follow me on fb

Here is the page link
I am not allowed to post the link by the website

why there is an underscore (_) between my name (my_name).

1 Like

Welcome to the forums! We can’t have spaces in the names of our variables, and according to the Python style guide, we should use snake_case to name variables. This method of naming variables dictates that we should separate words using underscores.

So, how can you write more words?

Welcome to the forums!

Can you clarify what you mean by your question?