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 = [x for x in thelist if thelist.index(x) in items]
 
print(elements)
Source by www.pythonprogramming.in #
 
PREVIOUS NEXT
Tagged: #acess #item #list #index
ADD COMMENT
Topic
Name
3+5 =