+ 2
Why woudk I want a \n on my output?
5 Respostas
+ 4
\n won't be visible like this.
print('Hello\nWorld')
... will turn into this output:
Hello
World
+ 3
Hello!
I will shortly introduce 2 popular programming languages.
Python:
Very powerful programming language in data science.
JavaScript:
Very powerful as web frontend programming language.
Without \n the same text would be like this:
Hello! I will shortly introduce 2 popular programming languages. Python: Very powerful programming language in data science. JavaScript: Very powerful as web frontend programming language.
\n represents a newline. Using newlines vicely increases readability of long texts.
+ 2
dorjee wangchuk \n are reserved word for (N)ew line. Interpreter find first symbol - in this case that was be \ (backslash) and expect (by default) that next letter was predefined. In short, \n is "NEW LINE".
+ 1
so that it looks good
+ 1
By the way, "Hello \n World!" was display:
Hello
World!
without white space.