Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Solution for "Remove Accents" solution in Uncategorized category for Remove Accents by Mariusz_Lesniak
from unicodedata import normalize
def checkio(in_string):
text = normalize('NFKD', in_string)
text = str(text.encode('ascii', 'ignore'))
text = text.replace("b'", "").replace("'", "")
if text == "":
return in_string
return text
#These "asserts" using only for self-checking and not necessary for auto-testing
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')
July 6, 2022