Python sort
来源:互联网 发布:海康摄像头无网络视频 编辑:程序博客网 时间:2024/06/05 03:25
sort()是没有返回值的 只是做了一个操作 对序列进行更改
所以 如果你有一个list=[1,2,3,4,5] 你sort()了 那么 那就再真的sort()了
你还想使用原来的 最好复制一份 而且 copy=list是没用的
你要another_copy=[1,2,3,4,5]
list=['4','5','w','a','g','14','ac']another_list =['4','5','w','a','g','14','ac']copy=listprint 'list is '+str(list)print list.sort()print 'sorted list is '+str(list)print 'another list is '+str(another_list)print 'copy is '+str(copy)
>>>
list is ['4', '5', 'w', 'a', 'g', '14', 'ac']
None
sorted list is ['14', '4', '5', 'a', 'ac', 'g', 'w']
another list is ['4', '5', 'w', 'a', 'g', '14', 'ac']
copy is ['14', '4', '5', 'a', 'ac', 'g', 'w']
- Python sort
- python sort()
- python-sort
- python sort
- Python的sort()
- python quick sort
- python insertion sort
- python heap sort
- [转]python sort reverse
- python dict sort
- Sort _ Python
- python list sort
- python中sort方法
- shell sort (python implementation)
- python sorted和sort
- 排序 sort python
- python sort使用
- python--sort,sorted,argsort
- 关于职场的经典视频链接
- 探秘Java虚拟机——内存管理与垃圾回收
- 青春划过指尖
- 字符串匹配
- HDU 2159
- Python sort
- SHELLEXECUTEINFO 和 ShellExecuteEx的使用
- 伤别
- IO流
- 无锁队列的实现
- 母亲,我叫钓鱼岛
- 从源代码安装软件
- 不用EasyUI,你OUT了
- Tomcat 解压版(非安装版)配置