Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

acess the item in list by index

thelist = [2, 11, 8, 9, 4, 1, 3]
items = [2, 4, 5]
elements = [e for i, e in enumerate(thelist) if i in items]
 
print(elements)
Source by www.pythonprogramming.in #
 
PREVIOUS NEXT
Tagged: #acess #item #list #index
ADD COMMENT
Topic
Name
3+8 =