列表 list

 例子:

#!/usr/bin/python
li = list([11,22,33,66,99,77])
print(li)
li.extend((44,55,))
print(li)
ret = li.pop(3)
print(li)
print(ret)
li.remove(22)
print(li)
li.reverse()
print(li)
li.sort()
print(li)

 

[11, 22, 33, 66, 99, 77]
[11, 22, 33, 66, 99, 77, 44, 55]
[11, 22, 33, 99, 77, 44, 55]
66
[11, 33, 99, 77, 44, 55]
[55, 44, 77, 99, 33, 11]
[11, 33, 44, 55, 77, 99]

 

posted @ 2016-01-24 22:23  侠之大者kamil  阅读(140)  评论(0编辑  收藏  举报