Page 91 - Information_Practice_Fliipbook_Class11
P. 91
Fig 4.14: Code Visualization through Python Tutor (after execution of lines 3 and 4)
Now, clicking <Next> executes line 5, which updates the value at index 4 of list lst1 to 100. Notice that each of the
names lst1 and lst2 refers to the same modified list object (Fig 4.15).
Fig 4.15: Code Visualization through Python Tutor (after execution of line 5)
At this stage, clicking <Next> executes line 6 associates the name lst1 and a new list object (indeed, it could as well
be an object of some other type) is created (Fig 4.16). As expected, the assignment of the list [3, 4, 2, 1] to the
variable lst1, did not impact the variable lst2, which continues to refer to the list [30, 60, 10, 20, 100].
Fig 4.16: Code Visualization through Python Tutor (after execution of line 6)
Data Types and Operators 77

