Message271817
>>> tab = [['x']*3]*3
>>> tab
[['x', 'x', 'x'], ['x', 'x', 'x'], ['x', 'x', 'x']]
>>> tab[1][0] = 5
>>> tab
[[5, 'x', 'x'], [5, 'x', 'x'], [5, 'x', 'x']]
>>>
why not only the element tab[1][0] is changed ? |
|
Date |
User |
Action |
Args |
2016-08-02 12:09:19 | antoine Zellmeyer | set | recipients:
+ antoine Zellmeyer, terry.reedy, ronaldoussoren, ned.deily |
2016-08-02 12:09:18 | antoine Zellmeyer | set | messageid: <1470139758.94.0.42567832187.issue27668@psf.upfronthosting.co.za> |
2016-08-02 12:09:18 | antoine Zellmeyer | link | issue27668 messages |
2016-08-02 12:09:18 | antoine Zellmeyer | create | |
|