Python Forum

Full Version: printing an string instead of a expression
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i want to print literally the string "\n", not the expression \n
how would i do that?
print('\\n')
Or you can use a raw string.
print(r'I want to see a \n and not have it be a line feed')
A problem with the raw string is it disables all escape sequences in the string.