This is part of a project I am working on, my question is that I don't know why are the values getting assigned to all the keys, when I just want to append them to the item with the key 'A', is there maybe another way to think it, I will need to append lists, creating a big list of lists per key.
speakers = ['A','B']
fragments = dict.fromkeys(speakers,[])
TAGS = ['A', ['121560', '124390']]
fragments[TAGS[0]].append(list(map(int,TAGS[1])))
print(fragments)
{'A': [[121560, 124390]], 'B': [[121560, 124390]]}
I need to obtain:
{'A': [[121560, 124390]], 'B': []}
And if I do again:
fragments[TAGS[0]].append(list(map(int,TAGS[1])))
Then I should get:
{'A': [[121560, 124390],[121560, 124390]], 'B': []}
Thank you!