What will be the output of len({'a': 1, 'b': 2, 'c': 3}) in Python?
-
A
1
-
B
2
-
C
3
Correct answer
-
D
Error
15 views
Explanation
The len() function returns the number of key-value pairs in a dictionary, so the result is 3.
Doubts & discussion
Not sure why the answer is C? Ask here and get an explanation.
Ask a doubt about this MCQ