Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

slice notation python

a[::-1]    # all items in the array, reversed
a[1::-1]   # the first two items, reversed
a[:-3:-1]  # the last two items, reversed
a[-3::-1]  # everything except the last two items, reversed
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #slice #notation #python
ADD COMMENT
Topic
Name
1+3 =