I have a SQL statement as a string in Python:
"""SELECT * FROM table WHERE keyword = '{keyword}'""".format(keyword=term)
Currently the above works for most terms, except those that have an apostrophe, which I understand is due to the double quote.
term = 'cat'
is OKAY
term = 'cat's ball'
is NOT OKAY
How can I format this string properly to allow for apostrophes in the term
string being passed to format
?