So I'm trying to write this exact string but I don't \n to make a new line I want to actually print \n on the screen. Any thoughts on how to go about this? (using python
Languages:\npython\nc\njava
So I'm trying to write this exact string but I don't \n to make a new line I want to actually print \n on the screen. Any thoughts on how to go about this? (using python
Languages:\npython\nc\njava
adding a backslash will interpret the succeeding backslash character literally. print("\\n")
.
Either escape the backslash by preceding it with another backslash:
'Languages:\\npython\\nc\\njava'
Or use a raw string by preceding the literal with an r
:
r'Languages:\npython\nc\njava'