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
When does an else clause attached to a for loop run?
from Python
intermediate
1 min
When does an else clause attached to a for loop run?
When the loop finishes without executing break, including zero iterations
Only when the iterable contains at least one item
Whenever the loop body raises an exception
Check
Ask AI about this kata
Report an error
previous kata
Enter the Python expression that creates an empty set
Fill in
next kata
After a = [1], b = a, and b.append(2), what is a?
Quiz
A new version is available
Reload