CBSE Class 11 Computer Science Question 28 of 63

Introduction to Python Modules — Question 9

Back to all questions
9
Question

Question 9

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
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.