carmelo-cyber / Carmelo_GitHub

All code for any situation
0 stars 0 forks source link

Calculate 1 #9

Open carmelo-cyber opened 1 year ago

carmelo-cyber commented 1 year ago

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}")