retrieve the first element in a list py code example
Example 1: python first n elements of list
a=list((1, 2, 3))
n=1
a[:n]
output:
[1]
Example 2: how to get first element of array in python
arr = ["cat", "dog", "rabbit"]
first_element = arr[0]
Example 3: how to prit a certian in a list python
how to prit a certian in a list python