how to get the first 4 elements of an a list in python code example Example: python first n elements of list a=list((1, 2, 3)) n=1 a[:n] output: [1]