Skip to content

Instantly share code, notes, and snippets.

@gaspart
Created October 3, 2021 11:27
Show Gist options
  • Save gaspart/fa85d00b9b79a452ee83cbea11a50924 to your computer and use it in GitHub Desktop.
Save gaspart/fa85d00b9b79a452ee83cbea11a50924 to your computer and use it in GitHub Desktop.
Estrae i caratteri, in ordine alfabetico, da una stringa di testo
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