Vidyalelo
Python · Q51

MCQs for Python Dictionaries: Exam

Programming · Python · question 51

Q51

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)

A.
25
B.
17
C.
16
Answer
D.
Tuples can't be made keys of a dictionary

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board