Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to step or only print every two element of list python

letters = ["a","b","c","d","e","f"]

print(letters[::2])

#output
#['a', 'c', 'e']
 
PREVIOUS NEXT
Tagged: #step #print #element #list #python
ADD COMMENT
Topic
Name
3+4 =