0
list. append with negative integer?
why does this code keep pushing 7 outside are they different elements? light= [[1]] def add_value(): light.append ([light[-1],7]) print(light) add_value() add_value() add_value() ------------------------------------------- output [[1], [[1], 7]] [[1], [[1], 7], [[[1], 7], 7]] [[1], [[1], 7], [[[1], 7], 7], [[[[1], 7], 7], 7]]
1 Réponse
0
Thanks