Vidyalelo
Python · Q62

MCQs for Python Dictionaries: Exam

Programming · Python · question 62

Q62

What will be the output of the following Python code snippet? a = a[1] = 1 a['1'] = 2 a[1.0]=4 count = 0 for i in a: count += a[i] print(count)

A.
An exception is thrown
B.
3
C.
6
Answer
D.
2

Answer: Option C

Solution

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