相关疑难解决方法(0)

链式作业如何运作?

来自某事的引用:

>>> x = y = somefunction()
Run Code Online (Sandbox Code Playgroud)

是相同的

>>> y = somefunction()
>>> x = y
Run Code Online (Sandbox Code Playgroud)

问题:是

x = y = somefunction()
Run Code Online (Sandbox Code Playgroud)

同样的

x = somefunction()
y = somefunction()
Run Code Online (Sandbox Code Playgroud)

根据我的理解,它们应该是相同的,因为somefunction只能返回一个值.

python python-3.x

29
推荐指数
5
解决办法
9479
查看次数

标签 统计

python ×1

python-3.x ×1