11
What is the output of the following code?
d = {'a': 1, 'b': 2}
for k, v in d.items():
print(k * v, end=' ')DiscussMedium
Loading subject content…
Loading practice questions…
What is the output of the following code?
d = {'a': 1, 'b': 2}
for k, v in d.items():
print(k * v, end=' ')What is the output of the following code?
d = {'x': 10}
d.setdefault('x', 99)
d.setdefault('y', 5)
print(d)What is the output of the following code?
d1 = {'a': 1}
d2 = {'b': 2, 'a': 9}
d1.update(d2)
print(d1)