Remove the last N elements of a list

前端 未结 7 756
傲寒
傲寒 2021-02-01 01:41

Is there a a better way to remove the last N elements of a list.

for i in range(0,n):
    lst.pop( )
7条回答
提交回复
热议问题