Consider a list of characters (characters may be alphabets, special characters, digits). Write a Python program to do the following:
1) Count total number of elements in the list
2) Count total number of vowels in the list (vowels are ‘a’, ‘e’, ‘i’, ‘o’, ‘u’)
3) Count total number of consonants in the list (a consonant is an alphabet other than vowel)
4) Count total number of characters other than vowels and consonants
Display all the values with appropriate titles.
listChar = ['$','a','8','!','9','i','a','y','u','g','q','l','f','b','t']
c = 0
cVowel = 0
cConst = 0
cOther = 0
for i in listChar :
c += 1
if i in 'aeiou' :
cVowel = cVowel + 1
elif i in '!@#$%^&*()+-*/123456789~`' :
cOther = cOther + 1
else :
cConst = cConst + 1
print ("total number of element in the list : ", c)
print("count vowels characters : ",cVowel)
print("count consonants characters : ",cConst)
print("count other characters : ",cOther)