Check out example codes for "python 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]

Learn ReactJs, React Native from akashmittal.com