I have a dictionary:
d = {'name': ['sarah', 'emily', 'brett'], 'location': ['LA', 'NY', 'Texas']}
I also have a list:
l = ['name', 'location']
I want to replace 'name' in the list l with the list ['sarah', 'emily', 'brett'] in dictionary d (same thing for location).
So the outcome would be:
l = ['sarah', 'emily', 'brett', 'LA', 'NY', 'Texas']
for item in l:
l.append(d[item])
l.remove(item)
this is what I did and I got a type error, unhashable type: 'list'. what should I do to fix this?