Computer Science
What will the following code display on execution?
X = statistics.mean([2, 15, 6, 19])
- 10.5
- 10.6
- Error
- None of these
Python Modules
1 Like
Answer
10.5
Reason — The statistics.mean()
function calculates the arithmetic mean of the numbers in the list. For the list [2, 15, 6, 19], the mean is computed as (2 + 15 + 6 + 19)/4 = 42/4 = 10.5.
Answered By
3 Likes
Related Questions
What output will be displayed after executing the following code?
statistics.median([11, 22, 33, 44, 55, 66])
- 28.5
- 38.5
- 5.5
- 6.5
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])
- 2.5
- 3.2
- 5.1
- 8.1
To include the use of functions which are present in the random library, we must use the option:
- import random
- random.h
- import.random
- random.random
What will be the output of the following code:
>>> import statistics >>> statistics.mode([2, 5, 3, 2, 8, 3, 9, 4, 2, 5, 6])
- 2
- 3
- 5
- 6