How can I include single and double quotes in the same string in python?
I know how to fix the problem if I am using only single quotes or double quotes. I am using the following code:
my_variable = """INSERT into
mytable("UpperAndLowerCaseColumn","Second_Column") VALUES('''O'neal''', '''"The Film Title"''')""".encode("utf-8").decode('unicode_escape')
print(my_variable)
I get this in return:
'INSERT into mytable("UpperAndLowerCaseColumn","Second_Column")
VALUES(\'\'\'O\'neal\'\'\', \'\'\'"The Film Title"\'\'\')'
What I need is this:
'INSERT into mytable("UpperAndLowerCaseColumn","Second_Column")
VALUES('''O''neal''', '''"The Film Title"''')'