This topic created in 3011 days ago, the information mentioned may be changed or developed.
6 replies • 2018-02-13 19:20:48 +08:00
 |
|
1
htfy96 Feb 13, 2018 1
slice := arr[:]
|
 |
|
2
boboliu Feb 13, 2018 via Android
Emmmm,楼上说得对
And,请一定注意 slice 是引用
|
 |
|
3
owenliang Feb 13, 2018
1 楼的切片引用,或者 copy 走。。
|
 |
|
5
mengzhuo Feb 13, 2018
@ admirez #4 就是 s1 = arr[:] s1[0] = 1 arr[0] == 1 # True
|