Graphing your data using package memory_graph can help your understanding of the Python Data Model:
import memory_graph as mg # see link above for install instructions
a = [10, 20, 30, 40, 50, 60, 70, 80, 90]
b = a
a[0] = a
a.append(a)
mg.show(locals()) # graph the local variables
Just like variable a
and b
can reference a list value, a list can reference a list value, including itself.
Full disclosure: I am the developer of memory_graph.