51. What will be the output of the following Python code?
count={}
count[(1,2,4)] = 5
count[(4,2,1)] = 7
count[(1,2)] = 6
count[(4,2,1)] = 2
tot = 0
for i in count:
tot=tot+count[i]
print(len(count)+tot)
count={}
count[(1,2,4)] = 5
count[(4,2,1)] = 7
count[(1,2)] = 6
count[(4,2,1)] = 2
tot = 0
for i in count:
tot=tot+count[i]
print(len(count)+tot)
52. What will be the output of the following Python code?
a={1:"A",2:"B",3:"C"}
for i in a:
print(i,end=" ")
a={1:"A",2:"B",3:"C"}
for i in a:
print(i,end=" ")
53. Which of these about a dictionary is false?
54. What will be the output of the following Python code?
a={1:"A",2:"B",3:"C"}
b=a.copy()
b[2]="D"
print(a)
a={1:"A",2:"B",3:"C"}
b=a.copy()
b[2]="D"
print(a)
55. What will be the output of the following Python code?
a={1:5,2:3,3:4}
a.pop(3)
print(a)
a={1:5,2:3,3:4}
a.pop(3)
print(a)
56. What will be the output of the following Python code?
a={1:"A",2:"B",3:"C"}
b={4:"D",5:"E"}
a.update(b)
print(a)
a={1:"A",2:"B",3:"C"}
b={4:"D",5:"E"}
a.update(b)
print(a)
57. What will be the output of the following Python code snippet?
>>>import collections
>>> a=collections.Counter([1,1,2,3,3,4,4,4])
>>> a
>>>import collections
>>> a=collections.Counter([1,1,2,3,3,4,4,4])
>>> a
58. If b is a dictionary, what does any(b) do?
59. What will be the output of the following Python code snippet?
>>> a={1:"A",2:"B",3:"C"}
>>> del a
>>> a={1:"A",2:"B",3:"C"}
>>> del a
60. What will be the output of the following Python code?
a={1:"A",2:"B",3:"C"}
a.clear()
print(a)
a={1:"A",2:"B",3:"C"}
a.clear()
print(a)