printing backslash

M

micklee74

hi
how can i sucessfully print |\| in the output of a print command

a = "|\|"
print a

but it gives me "|\\|"

i tried raw strings too, but it doesn't print |\| . It prints |\\|
instead

eventually, i also want |\| to be inside a list:
alist = ["|\|", 'blah', 'blah'] . How can i put |\| inside a list?

can someone show me how it can be done?
thanks
 
S

Steve Holden

hi
how can i sucessfully print |\| in the output of a print command

a = "|\|"
print a

but it gives me "|\\|"
No it doesn't:
i tried raw strings too, but it doesn't print |\| . It prints |\\|
instead

eventually, i also want |\| to be inside a list:
alist = ["|\|", 'blah', 'blah'] . How can i put |\| inside a list?

can someone show me how it can be done?
thanks

Well, you've got it now, so I won't labour the point.

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top