python count vowels in string
python program to get a String and count the number of vowels occurred in string.
Sample Input 1 :
Hello
Sample Output 1 :
2
Program or Solution
s=input("Enter a String:")
vowels=0
for i in s:
if(i=='a' or i=='e' or i=='i' or i=='o' or i=='u' or i=='A' or i=='E' or i=='I' or i=='O' or i=='U'):
vowels=vowels+1
print(vowels)
Program Explanation
visit each location in string s, if the character in the location is a vowel then increment vowels by 1.Comments
Related Programs
- length of the string in python
- find a character in a String Python
- occurences of character in string python
- lowercase to uppercase in python
- uppercase to lowercase in python
- Compare two Strings in python
- find vowels in string python
- find substring in string pyhton
- occurences of substring in a String python
- Reverse the String in python
- string Palindronme in python
- Remove the spaces in String python
- Remove the Vowels in String Python
coming Soon
coming Soon