Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

delete last few items from a list python

# Remove the last 3 items from a list
x = [1, 2, 3, 4, 5]
for i in range(3): x.pop()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #items #list #python
ADD COMMENT
Topic
Name
8+1 =