8 questions. Covers Aliasing in Python.
Questions 1 to 5 of 8
python class Node: def __init__(self, value, next=None): self.value = value self.next = next c = Node(3) b = Node(2, c) a = Node(1, b) a.next = c print(a.value, a.next.value) print(b.value, b.next.value)
python grid = [[1, 1], [2, 2]] shallow = grid.copy() shallow[0][0] = 9 shallow[1] = [5, 5] print('grid =', grid) print('shallow =', shallow)
python base = ['x', 'y'] view = base snapshot = tuple(base) base[0] = 'q' print(view, snapshot)
a.next = x
a
next
x
python a = [1, 2, 3] b = a print(a is b)
b = a
is
5 question(s) left on this page.