Question 5:Find the output of the following program:
d = {1 : [1, 2, 3], 2: (4, 6, 8)}
d[1].append(4)
print(d[1], end = " ")
li = [d[2]]
li.append(10)
d[2] = tuple(L)
print(d[2])
[1, 2, 3, 4] ((4, 6, 8), 10)
[1, 2, 3, 4] (4, 6, 8, 10)
[1, 2, 3, 4] TypeError: tuples are immutable
[1, 2, 3, 4] [4, 6, 8, 10]
This question is part of this quiz :
Python Dictionary Quiz