I want to remove all the 1's from the sublists so l becomes [[2], [2], [2]] but have trouble keeping track of indices. Can someone help out?
l = [[1, 2, 1],[1, 1, 2],[2, 1, 1]]
i = 0
for element in l:
while i < len(element):
if element[i] == 1:
element.pop(i)
i += 1
print l