I am trying to remove vowel objects that are in word(word is a list of letters making the userWord). If the userWord starts with consonant, the code works okay(removes all the vowels), but if useWord starts with vowel, it doesn't remove the first vowel while I want to remove all the vowels in the useWord. Did I skip something? Apologies, am a beginner. I'm using Python 3.8.5
def voweleater(userWord):
word = list(userWord)
vowels = ['a', 'e', 'i', 'o', 'u']
for letter in word:
for i in vowels:
if i in word:
word.remove(i)
print(letter)
voweleater("abstemious")
Code output:
a
s
t
m
s