Answers for "last elemenyt in python list"

1

python list except last element

>>> myList = list(range(1,5))
>>> myList
[1, 2, 3, 4]
>>> myList = myList[:-1]
>>> myList
[1, 2, 3]
Posted by: Guest on September-23-2020

Python Answers by Framework

Browse Popular Code Answers by Language