Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

list slicing in python

# List slicing
friends = ["Harry", "Tom", "Rohan", "Sam", "Divya", 45]
print(friends[0:4])
print(friends[-4:])
 
PREVIOUS NEXT
Tagged: #list #slicing #python
ADD COMMENT
Topic
Name
8+1 =