1What is the output of the following code?d = {1: 'one', 2: 'two'} print({v: k for k, v in d.items()})A{1: 'one', 2: 'two'}B['one', 'two']CErrorD{'one': 1, 'two': 2}View AnswerDiscussWorkspaceReportSaveEasy
2Which of these cannot be a dictionary key?A'key'B42C(1, 2)D[1, 2]View AnswerDiscussWorkspaceReportSaveEasy
3What is the output of the following code?from collections import defaultdict g = defaultdict(list) g['a'].append(1) print(dict(g))AErrorB{'a': 1}C{}D{'a': [1]}View AnswerDiscussWorkspaceReportSaveMedium
4What is the output of the following code?d = {i: i * i for i in range(4)} print(d[3])AErrorB9C3D6View AnswerDiscussWorkspaceReportSaveEasy
5What is the output of the following code?d = {'a': 1, 'b': 2} print(d.pop('a'), d)A1 {'b': 2}Ba {'b': 2}C1 {'a': 1, 'b': 2}DNone {'b': 2}View AnswerDiscussWorkspaceReportSaveEasy