Selected exercises from the end of the chapter.


Example Python Code

t3,t4 = [50,2], "going going gone"
t4 = t4.split()
t3 += t4
A1 = {"A":9, "B":8, "C":7, "D":6}
A2 = A1
A2[0] = False
A2 = type(A2)
a = b = "sub urban"
a[3] = "-"


(last line is a bug, for illustrative purpose)

Recommended: copy and paste this code into the Python Visualizer ( *once there, first click on Visualize Execution, then click on "edit this code", where you can cut, then paste in the code above ). to see a graphical view of item references, aliases, and mutating assignments.