forked from ravya1108/hactoberfest2023
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck string using python.py
46 lines (35 loc) · 1.07 KB
/
check string using python.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Python program to accept the strings
# which contains all the vowels
# Function for check if string
# is accepted or not
def check(string) :
string = string.lower()
# set() function convert "aeiou"
# string into set of characters
# i.e.vowels = {'a', 'e', 'i', 'o', 'u'}
vowels = set("aeiou")
# set() function convert empty
# dictionary into empty set
s = set({})
# looping through each
# character of the string
for char in string :
# Check for the character is present inside
# the vowels set or not. If present, then
# add into the set s by using add method
if char in vowels :
s.add(char)
else:
pass
# check the length of set s equal to length
# of vowels set or not. If equal, string is
# accepted otherwise not
if len(s) == len(vowels) :
print("Accepted")
else :
print("Not Accepted")
# Driver code
if __name__ == "__main__" :
string = "SEEquoiaL"
# calling function
check(string)