Test Index

Functions in Python Get it on Google PlayDownload on the App Store CBSE Board Videos

© examsnet.com
Question : 15 of 23
Marks: +1, -0
Predict the output of the following Python statements :
>>>import statistics as s
>>>s.mode ([10, 20, 10, 30, 10, 20, 30])
[CBSE 2024 Compartment]
Solution:  
Concept:
statistics.mode(data) returns the value that occurs most often in the data.
Explanation:
In [10, 20, 10, 30, 10, 20, 30]:
10 occurs 3 times, 20 occurs 2 times, 30 occurs 2 times.
The most frequent value is 10, so the output is
10
(18.57 is the mean: 130/7, not the mode.)
Answer:
Option C (10)
© examsnet.com
Advertisements
Go to Question: