Answers for "python get first three elements of array"

7

python first n elements of list

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

output:
[1]
Posted by: Guest on October-15-2020
3

how to get first element of array in python

arr = ["cat", "dog", "rabbit"]
first_element = arr[0]
Posted by: Guest on October-01-2020

Code answers related to "python get first three elements of array"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language