DEV Community

sankar
sankar

Posted on

python program to count total no of vowels in the given string

python program to count total no of vowels in the given string "Guvi Geeks Network Private Limited"

string = "Guvi Geeks Network Private Limited"
vowels = 0
for i in string:
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("Total no of vowels in given string = " , vowels)

Output:

Total no of vowels in given string = 12

Top comments (0)