← All tasks
🔍
Intermediate

Mutable Default Argument

⏱ 4 min ⭐ 110 XP 🔁 3 attempts allowed

What you'll do

Each call to add_item should start with a fresh empty list, but items pile up between calls.

Your task: Click the line that contains the bug. Select only the buggy line.

Scenario

Each call to add_item should start with a fresh empty list, but items pile up between calls.

Ready to try it?

Create a free account and subscribe to take "Mutable Default Argument". Earn 110 XP and track your internship progress.

Already have an account? Sign in