Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Newline | Strings
Introduction to Python | Mobile-Friendly
course content

Contenuti del Corso

Introduction to Python | Mobile-Friendly

Introduction to Python | Mobile-Friendly

1. Python Basics
2. Variables
3. Strings

book
Newline

In the previous chapter, you called on the print() function two times since you wanted to output two lines of text. Does this mean that we need a separate function for each line that we want to output? Surely not.

There are many special symbols in character encoding. One of them represents a line's ending and a new one's start. This symbol is \n. For example, let's show how to output two lines with one print() function.

12
# Output two lines with one print() function print("Section: 3\nChapter: 3")
copy
question mark

How many lines will be outputted after the code execution?

Select the correct answer

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 4

Chieda ad AI

expand
ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

course content

Contenuti del Corso

Introduction to Python | Mobile-Friendly

Introduction to Python | Mobile-Friendly

1. Python Basics
2. Variables
3. Strings

book
Newline

In the previous chapter, you called on the print() function two times since you wanted to output two lines of text. Does this mean that we need a separate function for each line that we want to output? Surely not.

There are many special symbols in character encoding. One of them represents a line's ending and a new one's start. This symbol is \n. For example, let's show how to output two lines with one print() function.

12
# Output two lines with one print() function print("Section: 3\nChapter: 3")
copy
question mark

How many lines will be outputted after the code execution?

Select the correct answer

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 4
Siamo spiacenti che qualcosa sia andato storto. Cosa è successo?
some-alt