I have the following code:
import unicodedata
my_var = \"this is a string\"
my_var2 = \" Esta es una oración que está en español \"
my_var3 = unicodedata.nor
You need to specify the encoding type.
Then you need to use unicode instead of string as arguments of normalize()
# -*- coding: utf-8 -*-
import unicodedata
my_var = u"this is a string"
my_var2 = u" Esta es una oración que está en español "
my_var3 = unicodedata.normalize(u'NFKD', my_var2).encode('ascii', 'ignore').decode('utf8')
output = my_var + my_var3
print(output)