Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python remove last element from list

# Revome the last item from a list
# If the list is empty, it will return an empty list
my_list = [1, 2, 3]
print(my_list[:-1]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #remove #element #list
ADD COMMENT
Topic
Name
3+3 =