Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial →
← CoursesPython FoundationsModule 2 · Data structuresPredict the conclusionpredict19 / 174
+75 XP
Task
📝 **Task:** Predict the output of a reference-sharing program. ```python a = [1, 2, 3] b = a b.append(4) print(a) ``` 📋 Type the list you expect into the output box. 💡 **Hint:** `b = a` does NOT copy the list — both variables point to the SAME list in memory. Changes through `b` are visible through `a`. 🎯 Think: what does `a` look like after `b.append(4)`?
Predict the output

Read the code carefully

a = [1, 2, 3]
b = a
b.append(4)
print(a)

What will the program print? Write here:

💬 Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…