get range of items of python list How do you access a range of elements from a list

The solution for “get range of items of python list How do you access a range of elements from a list” can be found here. The following code will assist you in solving the problem.

names = [‘Alice’, ‘Bob’, ‘Tom’, ‘Grace’]

names[1:3]
# Output:
# [‘Bob’, ‘Tom’]range(2,5,6,7)
print(range)

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in