Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python get the last element from the list

lst = [2, 5 , 6, 3, 8, 9]
n = len(lst) #get the length
last_el = lst[n-1] #get the last element
print("The last element of the list is:", last_el)
Source by maschituts.com #
 
PREVIOUS NEXT
Tagged: #python #element #list
ADD COMMENT
Topic
Name
5+8 =