python 列表元素的筛选

 

color = ['Red', 'Green', 'White', 'Black', 'Pink', 'Yellow']  
color = [x for (i,x) in enumerate(color) if i not in (0,4,5)]  
print(color)

 

posted @ 2018-11-16 20:07  anobscureretreat  阅读(2394)  评论(0编辑  收藏  举报