no.of vowels and consonants in a string

Sai_kiran_rachakonda · October 29, 2022
x = 'python'
count = 0
count1 = 0
for i in x:
    if i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u':
        count += 1
    else:
        count1 += 1
        
print(count)
print(count1)
Output

Comments

Please sign up or log in to contribute to the discussion.