I am trying to write a code that finds every instance in one list that does not start with an item in another list
I'm trying this:
list1 = ['1234', '2345', '3456', '4567']
list2 = ['1', '2']
for x in list1:
for y in list2:
if not x.startswith(y):
print(x)
but it returns this:
1234
2345
3456
3456
4567
4567
Which is baffling to me because if I remove "not" it can find items in list1 that start with an item in list2 just fine. How can I write a code that accomplishes my goal?