How to check if list item is in dictionary. If so, print the data associated with it
===

I have a list of names called `names`. I also have 2 dictionaries that contain a list of nested dictionaries that both have the key `names` and other data associated with the name. What I want to do is check that the name from the list is in one of the 2 dictionaries, if so, print the data associated only with that name. I can't find any of this stuff in the python docs

    names = ['barry','john','george','sarah','lisa','james']
    
    dict1 = {results:[{'name':'barry','gpa':'2.9','major':'biology'},
                      {'name':'sarah','gpa':'3.2','major':'economics'},
                      {'name':'george','gpa':'2.5','major':'english'}]}
    
    dict2 = {staff:[{'name':'john','position':'Lecturer','department':'economics'},
                    {'name':'lisa','position':'researcher','department':'physics'},
                    {'name':'james','position':'tutor','department':'english'}]}

    for x in names:
        if x in dict1:
            print gpa associated with the name
        elif x in dict2:
            print position associated with the name