8,3,2 are not divisible by 5 then it should have got appended to a. But in the result of a not getting those numbers. Why those numbers 8,3,2 are not reflecting.
l = [4, 7, 5, 10, 20, 50, 50, 8, 3, 2]
a = []
for i in l:
if (i%5)==0:
print(i)
break
else:
a.append(i)
print(a)
5 [4, 7]