python 2.7 does not support star expression

python 3 support star expression, but python 2.7 does NOT support star expression.

here is a example:

in python 3

>>> a, *b = (1, 2, 3)
>>> b
[2, 3]
>>> a, *b = (1,)
>>> b
[]

in python 2.7, you should do this instead:


c = (1, 2, 3)
a, b = c[0], c[1:]

打赏作者
这篇文章帮助很大,重重有赏

您的支持将鼓励我们继续创作!

[微信] 扫描二维码打赏

[支付宝] 扫描二维码打赏

正在跳转到PayPal...

发布者

键盘侠

female geek, creator of sscloud. keyword: php, html5+css3, python, wordpress

发表评论

电子邮件地址不会被公开。 必填项已用*标注