Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exam pull okey #92

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions exam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,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)
5 changes: 5 additions & 0 deletions okey.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def factorial(n):
if n == 0 or n == 1:
return 1
else:
return n * factorial(n-1)