nested-list tag

2 questions


1 answers
100 views
0
Can't I use that name when each nested list has a name in the nested list?

t7=(3, 17, 34, 57)t8=(5, 39, 57)t9=(8, 16, 23, 45, 54, 58)t10=(2, 20, 30)t11=(3, 19, 34, 57)t12=(8, 16, 27, 45, 54, 58)t13=(3, 17, 34, 57)t14=(2, 28, 30)t15=(4, 17, 34, 57)t16=(8, 16, 23, 45, 52, 58)t...

2 years ago

1 answers
124 views
0
I changed only one element in the list, but the whole element changed. Why is that?

[[1, 1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1]] I wrote it like this. myList = [[1] * 4] * 3I changed only one value at the beginning, but the whole value of the element changed.myList[0][0] = 5 #[5, 1, 1,...


© 2024 OneMinuteCode. All rights reserved.