我有时会遇到这种打印或返回列表的方式 - someList[:].我不明白为什么人们会使用它,因为它返回完整列表.
someList[:]
为什么不简单地写someList,没有[:]部分?
someList
[:]
python list notation shallow-copy slice
list ×1
notation ×1
python ×1
shallow-copy ×1
slice ×1