相关疑难解决方法(0)

python头部和尾部在一条线上

有没有pythonic方法解压缩第一个元素中的列表和单个命令中的"尾部"?

例如:

>> head, tail = **some_magic applied to** [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
>> head
1
>>> tail
[1, 2, 3, 5, 8, 13, 21, 34, 55]
Run Code Online (Sandbox Code Playgroud)

python list tail head

81
推荐指数
3
解决办法
8万
查看次数

标签 统计

head ×1

list ×1

python ×1

tail ×1