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")
Obrigado pelo seu feedback!
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Pergunte-me perguntas sobre este assunto
Resumir este capítulo
Mostrar exemplos do mundo real
Awesome!
Completion rate improved to 4
Newline
Deslize para mostrar o menu
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")
Obrigado pelo seu feedback!