[Python-ideas] list.pop() accepting a list of integers as argument
Serhiy Storchaka
storchaka at gmail.com
Thu Mar 26 08:41:53 CET 2015
More information about the Python-ideas mailing list
Thu Mar 26 08:41:53 CET 2015
- Previous message (by thread): [Python-ideas] list.pop() accepting a list of integers as argument
- Next message (by thread): [Python-ideas] Python Research Insitute
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 26.03.15 05:36, Ron Adam wrote:
> This is probably the fastest way to remove N items from the end.
>
> >>> L = list("123456789")
> >>> L
> ['1', '2', '3', '4', '5', '6', '7', '8', '9']
> >>> L[-3:] = []
> >>> L
> ['1', '2', '3', '4', '5', '6']
del L[-3:]
- Previous message (by thread): [Python-ideas] list.pop() accepting a list of integers as argument
- Next message (by thread): [Python-ideas] Python Research Insitute
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list