Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to slice odd index value from a list in python using slice function

num = [1,2,3,4,5]
res = num[slice(1, len(num)-1, 2)]
print(res)
 
PREVIOUS NEXT
Tagged: #slice #odd #index #list #python #slice #function
ADD COMMENT
Topic
Name
8+4 =