Python Practice › List Programs › Program 81

Count vowels in a list of words

EasyList Programs · 81 of 100

Write a Python program to count the vowels in a list of words.

Advertisement
Input
["Learning", "Python", "From", "SqaTool"]
Output
8

Approach

  1. Join and count characters in “aeiou”.

Solution

Python
words = ["Learning", "Python", "From", "SqaTool"]print(sum(ch in "aeiouAEIOU" for w in words for ch in w))
Output
8
Note

The words contain 3 + 1 + 1 + 3 = 8 vowels.

Learn the concept

New to this topic? Read the lesson, then come back.

More list programs

← All 100 List Programs

Leave a Comment