Created
October 3, 2021 11:27
-
-
Save gaspart/fa85d00b9b79a452ee83cbea11a50924 to your computer and use it in GitHub Desktop.
Estrae i caratteri, in ordine alfabetico, da una stringa di testo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print() | |
risultato = "" | |
risposta = input("scrivi una parola: ") | |
n = 0 | |
lista_testo = ["a", "b", "c", "d", "e", "f", "g", "h", "k", "j", | |
"i", "l", "m", "n", "o", "p", "q", "r", "s", "t", | |
"u", "v", "w", "x", "y", "z"] | |
for n in range(len(lista_testo)): | |
if (lista_testo[n] in risposta): | |
risultato = (risultato + lista_testo[n]) | |
n += 1 | |
print() | |
print(risultato) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment