Q:

Looping through lists in a dictionary and comparing to lists in a list

I am quite new to python so bear with me. 
Basically I have two sets of a data.  One is a dictionary that is made up of lists and the other is a list made up of lists:
my_dict =  {1: [1], 2: [1, 2], 3: [1, 3], 4: [1, 3, 4], 5: [1, 3, 4, 5], 6: [1, 3, 4, 5, 6]}

my_list = ([1, 1, 0], [1, 2, 100], [1, 3, 150], [1, 4, 150], [1, 5, 10], [1, 6, 20])

I want to compare the first two numbers in the list, with the numbers in the lists in the dictionary.  When the first two numbers in the list (i.e. (1,2)) are found in the lists in the dictionary I append the THIRD item in the list of lists to a new list (i.e. (100)). 
Here is my code so far:
def AON(my_dict, my_list):
    new_list = []
    o_d = 0

for key in my_dict:

    if my_list[o_d][0] and my_list[o_d][1] in my_dict[key]:
        new_list.append(my_list[o_d][2])
        o_d += 1
    else:
        o_d += 1

print (o_d)
print(new_list)

return new_list
return o_d
AON(my_dict, my_list)

The output is as follows:
new_list = [0, 100, 150, 150, 10, 20]

My problem is that my list of lists has 600 lists with three items each in them. My dictionary of lists has only 25 keys.  My result is that new_list has only 25 items in it - where in actual fact there should be 600 (as items such as (1,3) are found throughout the list of lists.  How do I make my loop keep checking for similar items between my_dict and my_list 600 times rather than just 25 times?
Thanks! 

A:

You are looping over my_dict, and adding (at most) one item per key value into new_list.
Instead, loop over my_list, and look for the first two elements of each in the dictionary to see if the associated value should be added to new_list.

