Re.findall() & Re.finditer()

  • + 0 comments

    Simple solution form my side..

    string = input()
    
    vowels = ['a','e','i','o','u']
    
    result = []
    word = ''
    for item in string:
        if( item.lower() in vowels):
            word = word +item
        else:
            if(len(word)>=2):
                result.append(word)
            word = ''
    
    if(len(result) == 0):
        print(-1)
    else:
        for words in result:
            print(words)