how to print a range of elements from list in python code example
Example: get range of items of python list
names = ['Alice', 'Bob', 'Tom', 'Grace']
names[1:3]
# Output:
# ['Bob', 'Tom']
names = ['Alice', 'Bob', 'Tom', 'Grace']
names[1:3]
# Output:
# ['Bob', 'Tom']