Potresti usare anche, tramite generatore "map", una funzione che assegna i codici UTF-8 delle vocali non accentate con le loro rispettive versioni accentate, probabilmente risulterà molto efficiente in termini di velocità.
map
Definition : map(func: Callable[[_T1], _S], iter1: Iterable[_T1], /) -> Iterator[_S]
map(func, *iterables) --> map object
Make an iterator that computes the function using arguments from each of the iterables. Stops when the shortest iterable is exhauste.
Oppure utilizza il metodo delle stringhe str.maketrans che il prof. ci ha mostrato venerdi.
Python maketrans () method
description
Python maketrans () method is used to create character mappings conversion table, for taking two parameters, the easiest way is called, the first argument is a string that represents the character to be converted, the second parameter is the string representation of the conversion aims.
Note: The two strings must be the same length as a one to one relationship.