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:]

本站提供的服务

  • wordpress主题、插件、开发、优化以及WordPress虚拟主机、VPS售卖
  • 自用Shadowsocks 服务器搭建 RMB50/次
  • VPN(PPTP&L2TP)流量出售: 5RMB/GB,10GB起售,8条台湾、美国、香港线路
    • 联系QQ:2564692806

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

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

      [微信] 扫描二维码打赏

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

      正在跳转到PayPal...

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

Leave a reply:

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Site Footer