Write a program that extract words starting with Vowel From A list


Topic: Write a program that extract words starting with Vowel From A list

Solution

test_list = ["have", "a", "good", "one"] 
  
print("The original list is : " + str(test_list)) 
  
res = [] 
vow = "aeiou"
for sub in test_list: 
    flag = False
      
    # checking for begin char 
    for ele in vow: 
        if sub.startswith(ele): 
            flag = True 
            break
    if flag: 
        res.append(sub) 
  
print("The extracted words : " + str(res)) 



List all Python Programs