Assuming all required modules have already been imported, identify the correct…

2023

Assuming all required modules have already been imported, identify the correct output of the following Python program segment:
from statistics import mean, mode
Data=[4,4,1,2,4]
print(mean(Data), mode(data))

  1. A.

    1 4 / 1 4

  2. B.

    4 1 / 4 1

  3. C.

    3 4 / 3 4

  4. D.

    4 3 / 4 3

Attempted by 1694 students.

Show answer & explanation

Correct answer: C

Compute the mean and mode of Data = [4, 4, 1, 2, 4].

  • Step 1: Mean calculation - Sum = 4 + 4 + 1 + 2 + 4 = 15, number of elements = 5, so mean = 15 / 5 = 3.

  • Step 2: Mode determination - Count frequencies: 4 appears 3 times, 1 appears once, 2 appears once. The mode is 4 (most frequent).

Printed output: 3 4

Explore the full course: Rssb Senior Computer Instructor