源码

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]
(0)

本文由 投稿者 创作,文章地址:https://blog.isoyu.com/archives/python-toubuheweibuzaiyitiaoxianshang.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:9 月 20, 2019 at 04:58 上午

热评文章