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:
- Take a list of words as input.
- Create a variable and assign its value equal to ‘aeiouAEIOU’
- Join the words in the string using join() and assign them to a variable.
- Using for loop and an if statement check whether vowels exist in the joined string.
- Count the total number of vowels.
- 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
Python program to get the list of prime numbers in a given list.
Python program to get a list with n elements removed from the left and right.
Python program to create a dictionary with two lists.
Python program to remove the duplicate item from the list using set.
Python program to insert a sublist into the list at a specific index.
Python program to calculate the bill per fruit purchased from a given fruits list.