Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python split at index

>>> list1 = ['a','b','c','d','e','f','g','h', 'i', 'j', 'k', 'l']
>>> print list1[:5]
['a', 'b', 'c', 'd', 'e']
>>> print list1[-7:]
['f', 'g', 'h', 'i', 'j', 'k', 'l']
# Note how you can slice either positively or negatively.
# When you use a negative number, it means we slice from right to left.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #split #index
ADD COMMENT
Topic
Name
4+7 =