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: , ,

0 comments:

Post a Comment

Copyright © UPgradeCODING | Powered by Blogger