How can I compare if a backslash is in my string?
I don't know how to write the backslash symbol to compare it. I try this but don't work:
Code:
s = r"\""
print s
Output: \"
If I try s = "\""
it gives "
as output
I don't know how to acheive that.
Thanks for any help.
You need to escape the backslash.
s = "\\"