Q:

How to iterate through a list in a dictionary in python

sampleDict={ “A1”:[“234-234-2234”, [“Brown”, “Bill”] ], “B2”:[“654-564-5564”,[“Jones”,”Jennifer”]] }

I have to check to see it "john" is in the dictionary and print the first and last name of everyone whose phone number begins with "654"
and my code is:
for i in sampleDict.keys():    
    for key in sampleDict[i]:
        print(key)

and how do i just print the last name in the list : "Brown"

A:

In general, you can access the different parts of the dictionary values through list indexing:
for (k,v) in sampleDict.iteritems():
    key          = k
    phone_number = v[0]
    last_name    = v[1][0]
    first_name   = v[1][0]
    # Do something

Each value is just a 2-element list, the first element corresponding to the phone number, and the second element, itself a list, with elements corresponding to the last and first name. 
But you could write the functions you're looking for with something like:
def is_john_here(d):
    for v in d.values():
        if v[1][1] == "john": return True
    return False

print is_john_here(sampleDict)  # False

Or
def find_people_by_number(d, prefix):
    for v in d.values():
        if v[0].startswith(prefix):
            print ', '.join(v[1])

find_people_by_number(sampleDict, '654')  # Jones, Jennifer

Or (from comments)
def last_names(d):
    for v in d.values():
        print v[1][0]

last_names(sampleDict)    # Brown
                          # Jones

