carmelo-cyber / Carmelo_GitHub

All code for any situation
0 stars 0 forks source link

Calculate 2 #11

Open carmelo-cyber opened 1 year ago

carmelo-cyber commented 1 year ago

Import the necessary libraries

import numpy as np

Define the array of numbers

numbers = [1, 2, 3, 4, 5]

Calculate the sum of the array

sum = np.sum(numbers)

Calculate the mean of the array

mean = np.mean(numbers)

Calculate the standard deviation of the array

std = np.std(numbers)

Print the results

print(f"Sum: {sum}") print(f"Mean: {mean:.2f}") print(f"Standard deviation: {std:.2f}")