Skip to content

Instantly share code, notes, and snippets.

@frantizek
Created February 1, 2022 00:15
Show Gist options
  • Save frantizek/41b2ef107af653ccc5ca41233cde9f69 to your computer and use it in GitHub Desktop.
Save frantizek/41b2ef107af653ccc5ca41233cde9f69 to your computer and use it in GitHub Desktop.
CountVowels = str(input("Escribe una frase o texto: "))
d_vowels = {"a": 0, "e": 0, "i": 0, "o": 0, "u": 0}
for letter in CountVowels:
if "a" in letter.lower():
d_vowels["a"] = d_vowels["a"] + 1
if "e" in letter.lower():
d_vowels["e"] = d_vowels["e"] + 1
if "i" in letter.lower():
d_vowels["i"] = d_vowels["i"] + 1
if "o" in letter.lower():
d_vowels["o"] = d_vowels["o"] + 1
if "u" in letter.lower():
d_vowels["u"] = d_vowels["u"] + 1
print("\nEl texto a analizar tiene {} caracteres:".format(len(CountVowels)))
for key, value in d_vowels.items():
print("La vocal '{}' aparece {} veces.".format(key, value))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment