Hello I'm getting an issue while I'm trying to remove every len of string in the list that is mod by 2
def remove_even_length(l):
for i in l:
if len(i) %2==0:
if i in l:
l.remove(i)
return l
wordlist = ["be", "is", "not", "or", "question", "the", "to"]
print(remove_even_length(wordlist))
what is happening is when it goes inside the list it skips ,[is , question] which both are mod 2 I don't know why it doesn't check the len of these 2 strings.