Python之L.pop()和del L[i]

# -*- coding: utf-8 -*-
#python 27
#xiaodeng
#Python之L.pop()和del L[i]   
#http://python.jobbole.com/82655/



L=[1,2,5,8,3,4,7]
#L.pop()
#删除L列表的最后一个元素
L.pop()
print L#[1, 2, 5, 8, 3, 4]



#del L[i]
del L[1]
print L#[1, 5, 8, 3, 4]

 

posted @ 2015-11-06 22:43  Xiao|Deng  阅读(904)  评论(0编辑  收藏  举报