-
Notifications
You must be signed in to change notification settings - Fork 0
Open
@hug2wisdom
Description
shallow copy(浅复制)
cubes = [1, 2, 4]
new_cubes = cubes[:]
print(new_cubes)
print(cubes)
# the result:
[1, 2, 4]
[1, 2, 4]
clear the list:
cubes = [1, 2, 4]
cubes[:] = []
print(cubes)
# the result
[]
Metadata
Metadata
Assignees
Labels
No labels