From 08fdfb6d44d5633d889b592cee9c0e1efd49e5ed Mon Sep 17 00:00:00 2001 From: anjly12 Date: Fri, 10 Apr 2026 07:51:24 +0530 Subject: [PATCH] Add implementations for array and math functions Implemented return statements for array and arithmetic functions, added matrix multiplication, random number generation, and graph plotting. --- assignment.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/assignment.py b/assignment.py index 6c26afb..7a37fcb 100644 --- a/assignment.py +++ b/assignment.py @@ -3,18 +3,31 @@ def create_array(): pass + return np.arange(1, 11) def array_arithmetic(a, b): pass + return a + b def slicing_example(arr): pass + return arr[:5] def matrix_multiplication(a, b): pass + return np.dot(a, b) def random_numbers(): pass + return np.random.rand(5) def plot_graph(): pass + x = np.arange(0, 11) + y = x ** 2 + + plt.plot(x, y) + plt.title("y = x^2") + plt.xlabel("x") + plt.ylabel("y") + plt.show()