Professional Documents
Culture Documents
We hope youplan
Study have already
Maplearned how to write simple Python programs
Tracks Current topic: 100
consisting of a single line that just prints a text. However, real programs Stage 1
Multi-line programs
contain a significant number of lines: from tens and hundreds for small
scripts to thousands and even more for large projects. So, in this lesson, you
will write programs that print multiple lines. Topic depends on:
Stage 1
Overview of the basic
Let's consider an example, the following code prints exactly three strings,
program
each on a new line:
Topic is required for:
1 print("I")
2 print("know")
Program execution
3 print("Python")
Stage 2
Comments
The output is:
1 I
Table of contents:
2 know
↑ Multi-line programs
3 Python
Discussion
You can run this example here or locally if you have already installed Python
on your computer.
There are other ways to print the same text using just one function call. We
will consider them in the next topics.
The print function also allows you to print an empty line with no string
specified:
1 print("I")
2 print()
3 print("know")
4 print()
5 print("Python")
1 I
3 know
5 Python
1 print("And")
3 print("you?")
And
you?
Report a typo
3370 users liked this piece of theory.. 40 didn't like it. What about you?
https://hyperskill.org/learn/step/5233 1/2
17/06/2021 Multi-line programs – JetBrains Academy
Start practicing
https://hyperskill.org/learn/step/5233 2/2