I wonder how can i iterate over a list2 and remove all ittems that contains one of the list1 ittems ?
list1 = [6, 7, 8, 9]
list2=['0009', '0001', '0008', '0003', '0004', '0005', '0006', '0007']
and result will be :
list2=[ '0001', '0003', '0004', '0005']
i try somthing like :
list1 = [6, 7, 8, 9]
list2=['0009', '0001', '0008', '0003', '0004', '0005', '0006', '0007']
for ittem in list2:
for digit in ittem:
if digit in ittem:
list2.remove(ittem)
print(list2)
for ittem in list2: for digit in ittem: if digit in ittem: list2
result :ValueError: list.remove(x): x not in list
ps : i dont want to creat a new list , i want to remove ittems .. Any ideas ?