2013年3月12日

(python learn) 6 -- 列表

摘要: 列表和元组一样都是序列类型。类似的序列类型还有字符串。那么既然有了元组为什么还要列表呢,因为元组中的元素不可以改变。1 >>> t1=('kramer',27,'male')2 >>> id(t1)3 1828945344804 >>> t1[1]=285 Traceback (most recent call last):6 File "<stdin>", line 1, in ?7 TypeError: object doesn't support item ass 阅读全文

posted @ 2013-03-12 17:25 kramer 阅读(191) 评论(0) 推荐(0) 编辑

导航