Q1
When building a backpack inventory in Python, why is a Dictionary (`{'potion': 3, 'key': 1}`) better than a plain List (`['potion', 'potion', 'key']`)?
Dictionaries pair exact Keys -> Values so updating 'potion' count or checking 'key' in bag takes instant O(1) lookup instead of looping through duplicates inside a long list.
Q2
Why does scores_copy = scores; scores_copy.append(99) secretly change the original scores list too?
= doesn't duplicate a list—it just gives the exact same list box a second nickname! To make an independent backup before editing, use scores.copy() or scores[:].
Q3
When should you store map coordinates ((10, 25)) in a Tuple instead of a List, and why do `Set`s remove duplicate high-score tags automatically?
Tuples () are locked (immutable) so fixed X/Y coordinates or RGB colors stay safe from accidental edits, whereas Sets {} automatically hold only unique items with fast in checks.
Q4
What happens if a function modifies a Global variable vs creating a hidden Local variable with the same name?
Assigning score = 10 inside def earn(): creates a temporary local variable inside earn() without updating the outer score! Pass values in via arguments and hand updates back cleanly via return.
Q5
How do **List Comprehensions ([x * 2 for x in nums if x > 0])** replace 4-line for + .append() loops neatly?
They combine looping, optional if filtering, and transformation cleanly in one readable Python line.
Q6
Why does saving a game's high score inside a variable disappear when you close Python—and how does `with open('scores.json', 'w')` fix it?
Variables live in temporary RAM that wipes on exit. Writing to JSON files using with open(...) saves player scores permanently onto disk and auto-closes the file safely.
Q7
How does enumerate(items) improve a quiz menu loop compared to range(len(items))?
for number, question in enumerate(quiz, start=1): gives you clean question numbering (1, 2, 3) alongside the question itself in one neat step.
Q8
Why does {'a': 1}['b'] crash with KeyError, while .get('b', 0) safely keeps going?
Square bracket lookup crashes if 'b' isn't present yet; .get('b', 0) safely returns default 0 whenever a new player or item hasn't been added yet.
Q9
How do Default Arguments (`def greet(name, badge='Starter'):`) make Python functions flexible?
Callers can skip optional settings (greet('Aarav') uses 'Starter'), or pass a custom override (greet('Aarav', 'Champion')) when needed.
Q10
Why is splitting a 300-line game into small single-job functions (draw_board(), check_winner(), ask_move()) easier to debug?
When one behavior breaks, you test and fix that single small function cleanly without breaking scoring or player input elsewhere.