Skip to content
This repository has been archived by the owner on May 26, 2019. It is now read-only.

在 列表生成式 一节中,有一处纰漏 #71

Open
nooooocato opened this issue Mar 29, 2019 · 0 comments
Open

在 列表生成式 一节中,有一处纰漏 #71

nooooocato opened this issue Mar 29, 2019 · 0 comments

Comments

@nooooocato
Copy link

for循环其实可以同时使用两个甚至多个变量,比如dict的items()可以同时迭代key和value:

d = {'x': 'A', 'y': 'B', 'z': 'C' }
for k, v in d.items():
... print(k, '=', v)
...
y = B
x = A
z = C

而在3.7.0的环境当中 实际上的输出是:
x = A
y = B
z = C

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant