19 Jan 2015

Counting Vowels

#Python

'''
The program counts number of vowels in a string s
'''


s = 'azcbobobegghakl'


s=s.lower()
count=0
i=0
while (i<len(s)):
    if (s[i] in 'aeiou'):
        count+=1
    i+=1
print "Number of vowels", count   


 

Categories: , ,

Related Posts:

  • Counting Vowels #Python ''' The program counts number of vowels in a string s ''' s = 'azcbobobegghakl' s=s.lower()count=0i=0while (i<len(s)):    if (s[i] in 'aeiou'):        count+=1… Read More

0 comments:

Post a Comment

Copyright © 2025 UPgradeCODING | Powered by Blogger