Python program to count and display vowels in a string

This python program counts the vowels in a string and displays them on the screen. We can do this in several ways. Here we will discuss a few popular methods to do this efficiently.

Source Code

The following source code first uses the Python For Loop that iterates each character in a string. Inside the For Loop, we have uses If statement that checks whether the character is a vowel (a, e, i, o, u, A, E, I, O, U) or not. If it is true, the value of vowels incremented; otherwise, skip that character.