Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Python
/
Python
What does [f() for f in [lambda: i for i in range(3)]] produce?
from Python
intermediate
1 min
What does [f() for f in [lambda: i for i in range(3)]] produce?
[2, 2, 2]
[0, 1, 2]
It raises NameError because i leaves the comprehension scope
Check
Ask AI about this kata
Report an error
previous kata
What does calling a generator function do before next() or iteration begins?
Quiz
next kata
For def render(source, /, *, compact=False), which call is valid?
Quiz
A new version is available
Reload