Computer Science

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

Python Modules

1 Like

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.

Answered By

2 Likes


Related Questions