Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "When does an else clause attached to a for loop run?" on CodeWiki (https://codewiki.com/practice/mcq/python/checkpoint-1/checkpoint-1-loop-else/).
Context (verbatim from the page):
"""
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
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in Python. Where you are unsure, say so.