A hard exercise to help build the right mental model for Python data.

The โ€œSolutionโ€ link visualizes execution and reveals whatโ€™s actually happening using ๐—บ๐—ฒ๐—บ๐—ผ๐—ฟ๐˜†_๐—ด๐—ฟ๐—ฎ๐—ฝ๐—ต: https://github.com/bterwijn/memory_graph

you are viewing a single comment's thread
view the rest of the comments
[โ€“] 6 points 1 month ago (1 child)

Nice puzzle and tool. I picked the right answer but I wasn't overly confident.

You could list {1: [100]} as another possible answer, if you assume:

spoilerb |= {...} is equivalent to b = b | {...}, but you also realise the lists are never deep-cloned.

  • source
  • hideshow 1 child comment