Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get last n in array python

array = ["a", "b", "c", "d"]

num_elements = 3
print(array[-num_elements:])
 
PREVIOUS NEXT
Tagged: #array #python
ADD COMMENT
Topic
Name
3+3 =