0
Why is //n here?
5 Respostas
+ 1
\n (not /n) is a line break. If you use \n in a string, the text that follows the \n will continue in the next line.
\ is an escape character and means that the next character is not to be treated as a special character but as a regular character. Because of the escape character, print('\\n') will print '\n' instead of a line break.
+ 1
Go to the code playground and try this:
print('This is\na string')
vs this:
print('This is\\na string')
0
But in the question there is back slash n and is this different from \n? and I still didn't get u.. I think my question is different..
0
And when I write simply it as a string the result is what I guess means only one backslask
0
Incase of input the result vary means two back slash is there