81. Problem to count the total number of vowels in a list.

In this Python list program, we will take a user input as a list and count the total number of vowels in a list with the help of the below-given steps.

Total number of vowels in a list:

  1. Take a list of words as input.
  2. Create a variable and assign its value equal to ‘aeiouAEIOU’
  3. Join the words in the string using join() and assign them to a variable.
  4. Using for loop and an if statement check whether vowels exist in the joined string.
  5. Count the total number of vowels.
  6. Print the output to see the result.
				
					#Input list
list1 = ["Learning", "Python", "From", "SqaTool"]
vowels = 'aeiouAEIOU'
count = 0

for word in list1:
    for char in word:
        if char in vowels:
            count += 1

#Printing output        
print(count)
				
			

Output :

				
					8
				
			

Related Articles

Print palindrome numbers from a given list

Get the list of prime numbers in a given list

Leave a Comment