Reputation: 687
how would I get this into a string in python? I know I need to escape special chars but I don't know how. I tried adding backslashes but it didn't seem to work. I' not sure what to do.
Here is the code:
</th><td class='tracking'>
Upvotes: 1
Views: 82
Reputation: 3981
I would just use triple-quotes like below, there's other ways but triple-quotes are pretty fool-proof in Python:
"""</th><td class='tracking'>"""
Upvotes: 3
Reputation: 122326
You can use double quotations:
s = "</th><td class='tracking'>"
This allows you to create a string which includes single quotations.
Single quotations work as well when you use backslashes for escaping:
s = '</th><td class=\'tracking\'>'
Upvotes: 2