183k views
2 votes
Write a value-returning function isVowel that returns the value true if a given character is a vowel and otherwisereturns false.

1 Answer

5 votes

Answer: Following is the function isVowel written in python:-

def isVowel(check):#defining isVowel function with parameter check

#following are the nested if else if for checking that check is a vowel or not if yes returning True if not returning False.

if check == "A" or check =="a":

return True

elif check == "E" or check =="e":

return True

elif check == "I" or check =="i":

return True

elif check == "O" or check =="o":

return True

elif check == "U" or check =="u":

return True

else:

return False

Step-by-step explanation:

In the function we are checking in each if or elif statement that check is a vowel or not if it is a vowel then returning True if not returning False.

User Rajiv Pingale
by
4.8k points