Article From:https://www.cnblogs.com/sea-stream/p/9971288.html

 

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

 

Link of this Article: Screening of Python list elements

Leave a Reply

Your email address will not be published. Required fields are marked *