Decode School

Decode School - The School for Problem Solvers
Need Assignment / Project Guidance (or) Training in Python?

find vowels in string python

python program to get two strings and print the vowels in string.

Sample Input 1 :


Sample Output 1 :


Program or Solution

s=input("Enter a String:")
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'):
            print(i,end=" ")


Program Explanation

visit each location in string s, if the character in the location is a vowel then print the character.