KnowledgeBoat Logo
|

Computer Science

On executing the following code, what output will be displayed?

statistics.mode([2.5, 3.2, 3.3, 2.5, 8.1, 9.9, 2.5, 5.1])

  1. 2.5
  2. 3.2
  3. 5.1
  4. 8.1

Python Modules

1 Like

Answer

2.5

Reason — The statistics.mode() function returns the most frequent value in the list. In the list [2.5, 3.2, 3.3, 2.5, 8.1, 9.9, 2.5, 5.1], the value 2.5 appears most frequently (three times), so it is the mode.

Answered By

1 Like


Related Questions