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