In [25]:
def counting():
print "Please enter an string and will count the vowels: "
x=raw_input()
vow=['a', 'e', 'i', 'o', 'u']
count=0
a=0
e=0
i=0
o=0
u=0
for qw in x:
if qw in vow:
count += 1
if qw == 'a':
a += 1
elif qw == 'e':
e += 1
elif qw == 'i':
i += 1
elif qw == 'o':
o += 1
elif qw == 'u':
u += 1
else:
pass
print "Have found %s vowels in the text" %count
print "found %s a" %a
print "found %s e" %e
print "found %s i" %i
print "found %s o" %o
print "found %s u" %u
In [26]:
counting()
In [ ]: