I am trying to remove numbers that have more length than 1. But it is skipping one of them. Can anyone explain why is it happening and how can i prevent it from happening in future?
a =[3, 4, 5, 6, 54, 43, 543]
for m in a:
if len(str(m))>1:
a.remove(m)
print(a)
Output>>> [3, 4, 5, 6, 43]
Expected Output>>> [3, 4, 5, 6]