Your algorithm is almost correct. The problem is with the if statement. If you tried print out item and b[i] before testing for equality you would see the problem.
>>> a = [[1],[0],[0]]
>>> b = [[1,2],[3,4],[5,6]]
>>> c = []
>>> for item in a:
>>> for i in range(len(b)):
>>> print("item == b[i] is {} == {} is {}".format(item, b[i],
item == b[i]))
>>> if item == b[i]:
>>> c.append(b[i])
item == b[i] is [1] == [1, 2] is False
item == b[i] is [1] == [3, 4] is False
item == b[i] is [1] == [5, 6] is False
item == b[i] is [0] == [1, 2] is False
item == b[i] is [0] == [3, 4] is False
item == b[i] is [0] == [5, 6] is False
item == b[i] is [0] == [1, 2] is False
item == b[i] is [0] == [3, 4] is False
item == b[i] is [0] == [5, 6] is False
You have essentially been checking that each element in a and b for equality. Rather you want to check the elements in each item of a for equality with the index of b.
eg.
for item_a in a:
for index_b, item_b in enumerate(b):
# only check index 0 of item_a as all lists are of length one.
print("item_a[0] == index_b is {} == {} is {}".format(item_a[0],
index_b, item_a[0] == index_b))
if item_a[0] == index_b:
c.append(item_b)
produces:
item_a[0] == index_b is 1 == 0 is False
item_a[0] == index_b is 1 == 1 is True
item_a[0] == index_b is 1 == 2 is False
item_a[0] == index_b is 0 == 0 is True
item_a[0] == index_b is 0 == 1 is False
item_a[0] == index_b is 0 == 2 is False
item_a[0] == index_b is 0 == 0 is True
item_a[0] == index_b is 0 == 1 is False
item_a[0] == index_b is 0 == 2 is False
enumerate is a builtin helper function that returns a tuple containing the index and element for each element in a list (or anything that is iterable).
Unless you need to I would also recommend flattening a as having nested lists is redundant here ie. a = [1, 0, 0].
Having said all this, if you can get your head around list comprehensions then coding a solution would be much simpler -- as evidenced by the other answers to your question.
bby an index from lista