Check out example codes for "python get first n elements of list". It will help you in understanding the concepts better.

Code Example 1

a=list((1, 2, 3))
n=1
a[:n]

output:
[1]

Code Example 2

l = [1, 2, 3, 4, 5]
print(l[:3])

Learn ReactJs, React Native from akashmittal.com