Computer Science
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
Python Modules
2 Likes
Answer
38.5
Reason — The statistics.median()
function calculates the median of a list of numbers. For the list [11, 22, 33, 44, 55, 66], which contains an even number of elements, the median is the average of the two middle numbers. The two middle numbers are 33 and 44, so the median is (33 + 44) / 2 = 38.5.
Answered By
1 Like
Related Questions
What value will be returned, if x = math.floor(-24.6) ?
- 24.6
- -24
- -25
- -24.6
What value will be displayed on executing the following arithmetic expression?
x = math.pow (0,-4)
- 1
- 16
- DomainError
- None of these
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
What will the following code display on execution?
X = statistics.mean([2, 15, 6, 19])
- 10.5
- 10.6
- Error
- None of these