1

I initialized a dictionary of empty lists, but when appending values to one list, all the lists get updated

margenes = dict.fromkeys(['su_a2b', 'hd_a2b', 'su_b2a', 'hd_b2a', 'L1s', 'L4s'],[])

margenes['su_a2b'].append(1)

margenes

{'L1s': [1],
 'L4s': [1],
 'hd_a2b': [1],
 'hd_b2a': [1],
 'su_a2b': [1],
 'su_b2a': [1]}

I tried jupyter as well, python is 3.6.3

Zensualito
  • 11
  • 2

0 Answers0