DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
how to slice even index value from a list in python using slice function
num = [1,2,3,4,5] res = num[slice(0, len(num), 2)] print(res) #[1, 3, 5]
PREVIOUS
NEXT
Tagged:
#slice
#index
#list
#python
#slice
#function
ADD COMMENT
Topic
COMMENT
Name
1+5 =
Submit