Open carmelo-cyber opened 1 year ago
import numpy as np
numbers = [1, 2, 3, 4, 5]
sum = np.sum(numbers)
mean = np.mean(numbers)
median = np.median(numbers)
print(f"Sum: {sum}") print(f"Mean: {mean}") print(f"Median: {median}")
Import the NumPy library
import numpy as np
Define the array of numbers
numbers = [1, 2, 3, 4, 5]
Calculate the sum of the numbers
sum = np.sum(numbers)
Calculate the mean of the numbers
mean = np.mean(numbers)
Calculate the median of the numbers
median = np.median(numbers)
Print the results
print(f"Sum: {sum}") print(f"Mean: {mean}") print(f"Median: {median}")