2

The task is to convert Де to Де. Does Python 3 has builtin function or I need to parse this string and then use builtin chr method to convert each number to string?

Artem Rys
  • 149
  • 9

2 Answers2

2

You can use the html.unescape function:

import html

text = 'Де'
result = html.unescape(text)
Willem Van Onsem
  • 443,496
  • 30
  • 428
  • 555
2

In python 3.4 and above, you can use html.unescape:

>>> import html
>>> print(html.unescape('Де'));
Де
Mureinik
  • 297,002
  • 52
  • 306
  • 350