+ 1
\n is not working
I tried to print following string """thanks you \n boss""" but it result comes the same string and \n is included
7 Respostas
+ 2
When you use triple quote for string, you don't use \n but you can go to the next line. You can do :
"""thanks you
boss"""
or
"thank you\nboss"
But don't mix the two !
see https://docs.python.org/3/tutorial/introduction.html (section 3.1.2 String)
+ 1
seems like i can just write 2 characters which means only "\"" is possible .... it confused me as the tutorial mentioned a full sentence
0
Don't try this in the code playground because it actually works in there.
Sigh...
0
Hi
0
the \n is still not working
0
Daniel you use double quotes?
it works fine for me , I tried print("2"+"\n2")
- 1
That's a comment. If you want to print text, use: print("Hi\nHow Are You?") see? Double quote.