How to print backslash with Python? -


when write:

print '\' or print "\" or print "'\'"

python doesn't print me backslash \ symbol.

what should expected result?

you need escape backslash preceding with, yes, backslash:

print "\\" 

the \ character called escape character, interprets character following differently. example, n letter, when precede backslash, becomes \n, newline character.

as can guess, \ needs escaped doesn't function escape character. have to... escape escape, essentially.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -