DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
get last element of a list python
a = [1, 2, 3, 4] print(a[-1]) #prints: 4 print(a[-2]) #prints: 3
Source by www.techiedelight.com #
PREVIOUS
NEXT
Tagged:
#element
#list
#python
ADD COMMENT
Topic
COMMENT
Name
7+1 =
Submit