i need help to write a program in python version 27 to count

i need help to write a program in python (version 2.7) to count the vowels and consonants of a text file (or a string).
thank you

Solution

str=input(\'enter a string : \');

v=0

c=0

for i in range(0,len(str)):

if str[i]==\'A\' or str[i]==\'a\' or str[i]==\'E\' or str[i]==\'e\' or str[i]==\'I\' or str[i]==\'i\' or str[i]==\'O\' or str[i]==\'o\' or str[i]==\'U\' or str[i]==\'u\':

v++;

else:

c++;

print \'vowels : \',v

print \'consonants : \',c

i need help to write a program in python (version 2.7) to count the vowels and consonants of a text file (or a string). thank youSolutionstr=input(\'enter a str

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site