mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
Merge pull request #8932 from wxy/20180327-Loop-better--A-deeper-look-at-iteration-in-Python
PRF:20180327 Loop better A deeper look at iteration in Python
This commit is contained in:
commit
049f59c21a
@ -258,8 +258,8 @@ def funky_for_loop(iterable, action_to_do):
|
||||
2. 反复从迭代器中获得下一项
|
||||
3. 如果我们成功获得下一项,就执行 `for` 循环的主体
|
||||
4. 如果我们在获得下一项时得到了一个 `StopIteration` 异常,那么就停止循环
|
||||
```
|
||||
|
||||
```
|
||||
def funky_for_loop(iterable, action_to_do):
|
||||
iterator = iter(iterable)
|
||||
done_looping = False
|
||||
|
Loading…
Reference in New Issue
Block a user