What will be the result of len({1, 2, 3, 4, 5}) in Python?
-
A
1
-
B
5
Correct answer
-
C
0
-
D
Error
15 views
Explanation
The len() function returns the number of elements in a set, so the result is 5.
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ