ExamVeda
Login
Home
31
What will be the output of the following Python code?
>>> import collections
>>> a=collections.OrderedDict((str(x),x) for x in range(3))
>>> a
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
32
What will be the output of the following Python code?
>>> a={}
>>> a.fromkeys([1,2,3],"check")
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
33
What will be the output of the following Python code snippet?
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
d1 == d2
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
34
What will be the output of the following Python code snippet?
d = {"john":40, "peter":45}
print(list(d.keys()))
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
35
What will be the output of the following Python code snippet?
test = {1:'A', 2:'B', 3:'C'}
test = {}
print(len(test))
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
36
Which of the following statements create a dictionary?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
37
What will be the output of the following Python code snippet?
a={1:"A",2:"B",3:"C"}
for i,j in a.items():
    print(i,j,end=" ")
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
38
What will be the output of the following Python code snippet?
test = {1:'A', 2:'B', 3:'C'}
del test[1]
test[1] = 'D'
del test[2]
print(len(test))
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
39
What will be the output of the following Python code?
>>> a={1:"A",2:"B",3:"C"}
>>> a.items()
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
40
Which of the statements about dictionary values if false?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board