Trouble understanding python syntax for assigning variables

This question already has an answer here:

  • Unpacking, extended unpacking, and nested extended unpacking 3 answers

  • a, b = b, a + b

    is the equivalent of

    a = b; b = a + b a = b; b = a + b except this would use the new value of a when assigning to b , not the original as intended.

    链接地址: http://www.djcxy.com/p/53550.html

    上一篇: 在同一行上打印数字范围

    下一篇: 无法理解分配变量的Python语法