🎯 Predict the Print · 2026-07-22
What does this print?
Read the code. Type the expected output. One puzzle per day.
from collections import ChainMap
defaults = {"host": "localhost", "port": 80}
user = {"port": 8080}
cfg = ChainMap(user, defaults)
print(cfg["host"], cfg["port"])Hint: ChainMap searches its mappings LEFT to RIGHT.
Like this format? Try 🕵️ Stack Trace Lineup — same daily-puzzle vibe for Python tracebacks. Both work without signup.
Want a real Python tutor for the bits these puzzles point at? Start lesson 1 — free after a free signup →