0

I need to convert word

name = 'Łódź'

to ASCII characters

output: 'Lodz'

I can't import any library like unicodedata. I need to do it in clear python. I've tried to encode than decode and nothing worked.

Feniks
  • 21
  • 3
  • 1
    If you really cannot import any library even from the standard library, and need a general solution, you will need to reimplement large parts of `unicodedata` yourself. – tripleee Feb 01 '20 at 21:00

1 Answers1

0

Well, a simple method would be to map and replace. This also does not require any special imports.

name = 'Łódź'
name=name.replace('Ł','L')
name=name.replace('ó','o')
name=name.replace('ź','z')
print(name)
Dibsyhex
  • 119
  • 7