Tuesday 25 October 2016

Python Sets:Checking whether a given string contains all the vowels in english language

Q: To check whether the given string contains all the vowels in english language.

Input

  1. Length of String
  2. And the String

Output

YES/NO

Implementation

Implemented using Python Sets

Code


size=raw_input();
st=raw_input();
flag=0
vowel=set()
mylist=['a','e','i','o','u']
for i in range(int(size)):
 if st[i] in mylist:
  vowel.add(st[i])
  if len(vowel)==5:
   print "YES"
   flag=1
   break
 
if flag==0: 
 print "NO"

No comments:

Post a Comment