Answers for "check for number of vowels character in string python"

4

finding all vowels in a string python

def find_all_vowels(Word: str):
    if Word == None or Word == "":
        raise Exception("The arguments 'Word' is None or empty")
    vowles_in_Word = []
    Word = Word.upper()
    Vowles_list = ["A","E","I","O","U"]
    for character in Word:
        if character in Vowles_list:
            vowles_in_Word.append(character)
    vowles_in_Word = tuple(vowles_in_Word)
    return vowles_in_Word

print(find_all_vowels("ahkiojkl"))

try:
    find_all_vowels(None)
    find_all_vowels("")
except Exception as error:
    print("Execption occoured",error)
Posted by: Guest on July-03-2021

Code answers related to "check for number of vowels character in string python"

Python Answers by Framework

Browse Popular Code Answers by Language