CBSE Class 11 Computer Science Question 31 of 63

Introduction to Python Modules — Question 12

Back to all questions
12
Question

Question 12

What will be the output of the following code:

>>> import statistics
>>> statistics.mode([2, 5, 3, 2, 8, 3, 9, 4, 2, 5, 6])
  1. 2
  2. 3
  3. 5
  4. 6
Answer

2

Reason — The statistics.mode() function returns the most frequently occurring value in a list. In the list [2, 5, 3, 2, 8, 3, 9, 4, 2, 5, 6], the value 2 appears the most times (three occurrences), so 2 is the mode.