This exception comes because the encoding is set differently on Python code.
To resolve this issue match the encoding set on the database and on Python code. For example:
In the above Python code encoding is set to UTF-8 which means the same encoding is set for the database as well.
After setting the same encoding it will execute successfully like below: