I have the code below and there are two lists in one list and I want to delete the elements in each list that are higher and lower certain values. The way I tried it does not work because it only deletes some values and I don't understand why.
liste = [[1,2,3,4], [3,4,5,6,7,8,9]]
for a in liste:
print(a)
for b in liste[liste.index(a)]:
print(b)
if b < 3:
print(f"{b} < 3")
liste[liste.index(a)].remove(b)
for c in liste[liste.index(a)]:
print(c)
if c > 6:
print(f"{c} > 6")
liste[liste.index(a)].remove(c)
print(liste)
liste[liste.index(a)]is pointless, just usea.