Test Index
Functions in Python
© 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 is10(18.57 is the mean: 130/7, not the mode.)Answer:Option C (
10)© examsnet.com
Go to Question: