What make "\n\n" ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What make "\n\n" ?

8th May 2017, 2:50 PM
Ahmed bentabet
Ahmed bentabet - avatar
5 Answers
+ 19
\n is a Python literal which is ASCII Linefeed (LF) it means a newline in a string. :D
8th May 2017, 2:54 PM
Dev
Dev - avatar
+ 5
"\n" means a new line, so "\n\n" us two new lines. >>> print("n\n\nn") n n
8th May 2017, 2:55 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 5
You are right guy's I made a mistake with the /* it is kind of confusing while trying to get some basics with more then 2 different languages. ...
8th May 2017, 2:58 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 4
@Ahmed, with \n you start end or end a comment or text line that includes explanation for example. This way you will be able to read the code better in case you encounter an error...
8th May 2017, 2:54 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 1
when printing a string the interpreter needs instructions for certain values. the "\" is the escape character so the interpreter knows to process the next characters as an ASCII sequence or code or even character. '\n' is the escape code for "newline" so "\n\n" equals two new lines as if you had pressed "Return" or "Enter" twice.
8th May 2017, 3:06 PM
Aaron Nelson
Aaron Nelson - avatar