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
>>> import collections
>>> a=collections.OrderedDict((str(x),x) for x in range(3))
>>> a
32. What will be the output of the following Python code?
>>> a={}
>>> a.fromkeys([1,2,3],"check")
>>> a={}
>>> a.fromkeys([1,2,3],"check")
33. What will be the output of the following Python code snippet?
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
d1 == d2
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
d1 == d2
34. What will be the output of the following Python code snippet?
d = {"john":40, "peter":45}
print(list(d.keys()))
d = {"john":40, "peter":45}
print(list(d.keys()))
35. What will be the output of the following Python code snippet?
test = {1:'A', 2:'B', 3:'C'}
test = {}
print(len(test))
test = {1:'A', 2:'B', 3:'C'}
test = {}
print(len(test))
36. Which of the following statements create a dictionary?
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=" ")
a={1:"A",2:"B",3:"C"}
for i,j in a.items():
print(i,j,end=" ")
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))
test = {1:'A', 2:'B', 3:'C'}
del test[1]
test[1] = 'D'
del test[2]
print(len(test))
39. What will be the output of the following Python code?
>>> a={1:"A",2:"B",3:"C"}
>>> a.items()
>>> a={1:"A",2:"B",3:"C"}
>>> a.items()