Report Bug

Qus

What will be the output of the following Python code?

d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.values():
    print(d[x])
Qus

निम्नलिखित Python कोड का आउटपुट क्या होगा?

d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.values():
    print(d[x])


A. 0 1 2
B. a b c
C. 0 a 1 b 2 c
D. none of the mentioned


Solution
D. none of the mentioned



Explanation
Causes a KeyError.
Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad