Finishing 7 new elements

This commit is contained in:
2020-01-09 17:35:57 +01:00
parent 1dcfd757e8
commit f6539aedaa
7 changed files with 404 additions and 0 deletions

12
OReilly/remove-accents.py Normal file
View File

@@ -0,0 +1,12 @@
import unicodedata
def checkio(in_string):
"""remove accents"""
return ''.join(c for c in unicodedata.normalize('NFD', in_string) if unicodedata.category(c) != 'Mn')
if __name__ == '__main__':
assert checkio(u"préfèrent") == u"preferent"
assert checkio(u"loài trăn lớn") == u"loai tran lon"
print('Done')