weird behaviour with list of dictionaries in python

前端 未结 2 946
春和景丽
春和景丽 2021-01-22 11:59

Here is a simple code that performs operations on lists:

>>> a = [0] * 5
>>> a
[0, 0, 0, 0, 0]
>>> a[0] = 5
>>> a
[5, 0, 0, 0         


        
2条回答
提交回复
热议问题