Vidyalelo
Python · Q71

MCQs for Python Dictionaries: Exam

Programming · Python · question 71

Q71

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

A.
1
B.
2
C.
4
Answer
D.
Error, the keys can't be a mixture of letters and numbers

Answer: Option C

Solution

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