>>> l = list('sdf')
>>> l
['s', 'd', 'f']
>>> id(l)
4520422000
>>> l.reverse()
>>> id(l)
4520422000
>>> l.extend(list('fff'))
>>> id(l)
4520422000
>>> l.sort()
>>> id(l)
4520422000

  对list使用上述方法不会产生新对象,而是在对象本身上操作。

reverse(), extend(), sort() methods of list的更多相关文章

  1. Python 列表排序方法reverse、sort、sorted详解

    python语言中的列表排序方法有三个:reverse反转/倒序排序.sort正序排序.sorted可以获取排序后的列表.在更高级列表排序中,后两中方法还可以加入条件参数进行排序. reverse() ...

  2. 数组的重排序方法reverse()和sort()

    js数组中存在两个可以直接用来重排序的方法:reverse()和sort(). reverse()方法比较简单,直接反转数组项的顺序: var arr = [1, 3, 2, 4, 5]; arr.r ...

  3. list源码4(参考STL源码--侯捷):transfer、splice、merge、reverse、sort

    list源码1(参考STL源码--侯捷):list节点.迭代器.数据结构 list源码2(参考STL源码--侯捷):constructor.push_back.insert list源码3(参考STL ...

  4. js数组排序 reverse()和sort()方法的使用

    WEB前端|js数组排序reverse()和sort()方法的使用,数组中已经存在两个可以直接用来重排序的方法:reverse()和sort(). reverse()方法会对反转数组项的顺序. var ...

  5. python 列表排序方法reverse、sort、sorted基础篇

    python语言中的列表排序方法有三个:reverse反转/倒序排序.sort正序排序.sorted可以获取排序后的列表.在更高级列表排序中,后两中方法还可以加入条件参数进行排序. reverse() ...

  6. python列表排序方法reverse、sort、sorted

    python语言中的列表排序方法有三个:reverse反转/倒序排序.sort正序排序.sorted可以获取排序后的列表.在更高级列表排序中,后两中方法还可以加入条件参数进行排序. reverse() ...

  7. Python 列表排序方法reverse、sort、sorted操作方法

    python语言中的列表排序方法有三个:reverse反转/倒序排序.sort正序排序.sorted可以获取排序后的列表.在更高级列表排序中,后两中方法还可以加入条件参数进行排序. reverse() ...

  8. Python列表排序方法reverse、sort、sorted详解

    python语言中的列表排序方法有三个:reverse反转/倒序排序.sort正序排序.sorted可以获取排序后的列表.在更高级列表排序中,后两中方法还可以加入条件参数进行排序. reverse() ...

  9. 数组排序方法(join()、reverse()、sort())

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

随机推荐

  1. 来认识下less css

    简介 感觉自己都out了,跟不上web时代的潮流了,前不久才刚接触这玩意,发觉lesscss在某些方面还挺有用的,说白了这东西就是一种动态的样式语言,语法类似于css,可以像java那样进行编译,生成 ...

  2. ExtJs之Ext.form.field.TimePicker DatePicker组合框

    <!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv ...

  3. VISO下载地址

    http://pan.baidu.com/share/home?uk=4011207371#category/type=0

  4. badboy 之 查看回放结果

    在运行脚本时,Badboy提供了Summary功能方便我们监控回放结果状态,如下Summary view: 以下表格对运行情况的各个维度进行解释: 统计点 描述 Played 运行或回放脚本的次数 S ...

  5. C#DataGridView 美化

    private void dataGridView(DataGridView dataGridView) { System.Windows.Forms.DataGridViewCellStyle da ...

  6. Project Euler 108:Diophantine reciprocals I 丢番图倒数I

    Diophantine reciprocals I In the following equation x, y, and n are positive integers. For n = 4 the ...

  7. ks全自动安装centos

    1. 全新安装centos,选择好所需定制包 2. 完成安装后会在root下面生成一个install.log(rpm包列表)anaconda-ks.cfg(下文的ks.cfg基于此文件修改) 3. 将 ...

  8. ubuntu系统使用minicom终端操作说明

    http://blog.chinaunix.net/uid-22030783-id-3350834.html 在linux下,使用minicom作为串口终端工具,默认的串口设备是/dev/ttyS0, ...

  9. Android核心分析之二十三Andoird GDI之基本原理及其总体框架

     Android GDI基本框架 在Android中所涉及的概念和代码最多,最繁杂的就是GDI相关的代码了.但是本质从抽象上来讲,这么多的代码和框架就干了一件事情:对显示缓冲区的操作和管理. GDI主 ...

  10. Log4J入门教程(二) 参数讲解

    继续接着Log4J入门教程(一)中的例子进行讲解,其中log4j.properties中的内容为    Log4j的三个重要组件—— Loggers, Appenders, Layouts ,这三个组 ...