Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get vowels from string python

def get_vowels(word:str):
    """
    return the number of vowels that has a word

    Args:
        word (str): the word used to find the number of vowels
    """
    vowels = ['a', 'e', 'i', 'o', 'u']
    number_of_vowels = 0
    for letter in word:
        for vowel in vowels:
            if letter == vowel:number_of_vowels+=1;break    
    return number_of_vowels
 
PREVIOUS NEXT
Tagged: #vowels #string #python
ADD COMMENT
Topic
Name
3+5 =