My assignment requires to create a dictionary with a list of values for each key. Then, it provides an invert function and asks to modify the function so that every item in the list is a new key. My understanding is this.
a={'a':['2','3','4'], 'b':['1','5','6']}
b={'2':'a', '3':'a','4':'a','1':'b','5':'b','6':'b'}

I created a test dictionary with tuples instead of lists and I was able to invert them but I don't know how to turn the lists in the dictionary into tuples and then into individual items that would correspond to the same value.
I watched youtube tutorials and tried googling it (including stack overflow) but cannot get how to complete it.
At this point, I don't even know anything - I would definitely appreciate any explanation as I feel completely confused.

```

def invert_dict(d):
     inverse = dict()
     for key in d:
          val = d[key]
          if val not in inverse:
               inverse[val] = [key]
          else:
               inverse[val].append(key)
     return inverse

#my initial dictionary
work_contacts={'Lauren' : '617-111-2222', 'Sana' : '781-234-1212', 'Kelly': '845-234-1515', 'Jose' : '946-999-3210', 'Sabrina' : '617-222-5656', 'Shirika' : '410-231-9090', 'Rachel': '823-432-2121'}

c=invert_dict(work_contacts)
c
{'617-111-2222': ['Lauren'], '781-234-1212': ['Sana'], '845-234-1515': ['Kelly'], '946-999-3210': ['Jose'], '617-222-5656': ['Sabrina'], '410-231-9090': ['Shirika'], '823-432-2121': ['Rachel']}
c['617-111-2222'] #calling the first key
['Lauren']

#the dictionary for the assignment
work_contacts={'Lauren' : ['617-111-2222', 'lauren@company.org'], 'Sana' : ['781-234-1212', 'sana@company.org'], 'Kelly': ['845-234-1515', 'kelly@company.org'], 'Jose' : ['946-999-3210', 'jose@company.org'], 'Sabrina' : ['617-222-5656', 'sabrina@company.org'], 'Shirika' : ['410-231-9090', 'shirika@comoany.org'], 'Rachel': ['823-432-2121', 'rachel@company.org']}

#the error comes back like this
invert_dict(work_contacts)
Traceback (most recent call last):
  File "<pyshell#10>", line 1, in <module>
    invert_dict(work_contacts)
  File "<pyshell#2>", line 5, in invert_dict
    if val not in inverse:
TypeError: unhashable type: 'list'

#I tried to turn the lists into tuples
def l_t(s):
    final = []
    for k, v in test.items():
        if v in final:
            final.append(k)
        final = tuple(final)
    return s

l_t(work_contacts)
{'Lauren': ['617-111-2222', 'lauren@company.org'], 'Sana': ['781-234-1212', 'sana@company.org'], 'Kelly': ['845-234-1515', 'kelly@company.org'], 'Jose': ['946-999-3210', 'jose@company.org'], 'Sabrina': ['617-222-5656', 'sabrina@company.org'], 'Shirika': ['410-231-9090', 'shirika@comoany.org'], 'Rachel': ['823-432-2121', 'rachel@company.org']}

def l_t(s):
    p=s
    final = []
    for k, v in test.items():
        if v in final:
            final.append(k)
        final = tuple(final)
    return p

l_t(work_contacts)
{'Lauren': ['617-111-2222', 'lauren@company.org'], 'Sana': ['781-234-1212', 'sana@company.org'], 'Kelly': ['845-234-1515', 'kelly@company.org'], 'Jose': ['946-999-3210', 'jose@company.org'], 'Sabrina': ['617-222-5656', 'sabrina@company.org'], 'Shirika': ['410-231-9090', 'shirika@comoany.org'], 'Rachel': ['823-432-2121', 'rachel@company.org']}

`def l_t(s):
    p=s
    final = []
    for k, v in p.items():
        if v in final:
            final.append(k)
        final = tuple(final)
    return p

l_t(work_contacts)
{'Lauren': ['617-111-2222', 'lauren@company.org'], 'Sana': ['781-234-1212', 'sana@company.org'], 'Kelly': ['845-234-1515', 'kelly@company.org'], 'Jose': ['946-999-3210', 'jose@company.org'], 'Sabrina': ['617-222-5656', 'sabrina@company.org'], 'Shirika': ['410-231-9090', 'shirika@comoany.org'], 'Rachel': ['823-432-2121', 'rachel@company.org']}

#I then tried to tuple the values 
tuple(work_contacts.values())
(['617-111-2222', 'lauren@company.org'], ['781-234-1212', 'sana@company.org'], ['845-234-1515', 'kelly@company.org'], ['946-999-3210', 'jose@company.org'], ['617-222-5656', 'sabrina@company.org'], ['410-231-9090', 'shirika@comoany.org'], ['823-432-2121', 'rachel@company.org'])

#I have generated much more code with error messages, as below
b=invert_dict(test)
b
{(2, 'al', 3): ['a'], ('we', 'as', 4): ['blue']}

b[2]
Traceback (most recent call last):
  File "<pyshell#145>", line 1, in <module>
    b[2]
KeyError: 2
b(2)
Traceback (most recent call last):
  File "<pyshell#146>", line 1, in <module>
    b(2)
TypeError: 'dict' object is not callable
b(2, 'al', 3)
Traceback (most recent call last):
  File "<pyshell#147>", line 1, in <module>
    b(2, 'al', 3)
TypeError: 'dict' object is not callable
b[1]
Traceback (most recent call last):
  File "<pyshell#148>", line 1, in <module>
    b[1]
KeyError: 1```

```