I am new to python and I'm trying to do a exercise, a part of it I had to remove certain elements which are bigger than 2 but there is a problem with 'four'. I don't understand why the code doesn't remove 'four' again after it does once. this problem only happens with 'four' as I noticed. Here's the code I hope you can help me:
a = input().split()
a = [int(i) for i in a]
for i in a:
if i > 2:
a.remove(i)
print(a)