For each of today’s exercises, give the answer to the exercise and draw the memory diagram at the end of the program.
What does the following program print?
= ["foo", "bar"]
a = a
b = a[0:2]
c 1] = "buzz"
b[print(a[1], b[1], c[1])
What is the output of each print
call in the
following program?
= [3, 4, 5]
a 0, 4)
a.insert(2:] = a[1:4]
a[4)
a.remove(5))
a.append(a.index(del a[1]
print(len(a))
= [3]
a = a
b 4)
a.append(= a[0]
c = b
d 17, 19))
a.extend((= a[-2:]
x = x + [4] e
a
itself) point to the same list as a
?