Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python last element in list

# To get the last element in a list you use -1 as position
bikes = ['trek', 'redline', 'giant']
bikes[-1]
# Output:
# 'giant'
 
PREVIOUS NEXT
Tagged: #python #element #list
ADD COMMENT
Topic
Name
2+6 =