0

I am not sure that this popular answer works in Python 3 since there is no unicode in Python 3.

Therefore, how can replace accented letters with the respective non-accented ones at Python 3?

For example,

sentence = 'intérêt'

to

new_sentence = 'interet'
Outcast
  • 4,967
  • 5
  • 44
  • 99

1 Answers1

1

The linked answer references the third-party module unidecode, not Python 2's unicode type.

$ python3
Python 3.7.1 (default, Nov 19 2018, 13:04:22)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import unidecode
>>> unidecode.unidecode('intérêt')
'interet'
chepner
  • 497,756
  • 71
  • 530
  • 681