Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "A function appends to a default parameter items=[]. What happens across calls that omit items?" on CodeWiki (https://codewiki.com/practice/mcq/python/checkpoint-2/checkpoint-2-default-lifetime/).
Context (verbatim from the page):
"""
A function appends to a default parameter items=[]. What happens across calls that omit items?
The calls reuse one list created when the def statement ran
Each call receives a newly created empty list
Python copies the list after each return
"""
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.