Rodripelto

Palabra con más vocales

Dec 1st, 2021
1,411
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. palabras=["Arbol","Paris","Madrid","Manzana","Lapicero"]
  2. vocales ="aeiou"
  3. max=0
  4. masvocales=""
  5. for palabra in palabras:
  6.   nvocales=0
  7.   for vocal in vocales:
  8.     nvocales+=palabra.lower().count(vocal)
  9.   if nvocales>max:
  10.     max = nvocales
  11.     masvocales = palabra
  12. print("La palabra con más vocales es :",masvocales)
RAW Paste Data