Answers for "slice elements list python"

1

list slicing in python

# List slicing
friends = ["Harry", "Tom", "Rohan", "Sam", "Divya", 45]
print(friends[0:4])
print(friends[-4:])
Posted by: Guest on January-12-2022

Python Answers by Framework

Browse Popular Code Answers by Language