my_first_script.py

my_first_script.py#

 1import numpy as np
 2
 3def nerdy_computation(x):
 4    """Returns the sum of the squares of the first x natural numbers using numpy."""
 5    numbers = np.arange(1, x + 1)
 6    squares = np.square(numbers)
 7    return np.sum(squares)
 8
 9print("Hello MUDE! Let's compute something nerdy:")
10result = nerdy_computation(10)
11print(f"The sum of the squares of the first 10 natural numbers is {result}")