From d45a31970f05802b9fb318dc0555a0d845876377 Mon Sep 17 00:00:00 2001 From: Donald Calloway Date: Mon, 29 Sep 2025 10:18:23 -0700 Subject: [PATCH] Add formatted text to first three np arrays --- array_creation_functions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/array_creation_functions.py b/array_creation_functions.py index 9f0b4ed..cc29d42 100644 --- a/array_creation_functions.py +++ b/array_creation_functions.py @@ -1,13 +1,13 @@ import numpy as np # Сreating a 1D array of zeros with 5 elements zeros_1d = np.zeros(5) -print(zeros_1d) +print(f'1D array of 5 zeros: {zeros_1d}') # Сreating a 1D array of zeros with specifying dtype zeros_1d_int = np.zeros(5, dtype=np.int8) -print(zeros_1d_int) +print(f'1D array of 5 zeros of dtype int8: {zeros_1d_int}') # Сreating a 2D array of zeros of shape 5x3 zeros_2d = np.zeros((5, 3)) -print(zeros_2d) +print(f'2D array of zeros of shape 5x3: {zeros_2d}') # Create an array of zeros of size 5 zeros_array_1d = np.zeros(5) @@ -22,4 +22,5 @@ sevens_array_2d = np.full((2, 2), 7) print(f'1D zeros array: {zeros_array_1d}, 1D ones array: {ones_array_1d}') print(f'2D zeros array:\n{zeros_array_2d}') print(f'2D ones array:\n{ones_array_2d}') -print(f'2D sevens array:\n{sevens_array_2d}') \ No newline at end of file +print(f'2D sevens array:\n{sevens_array_2d}') +