From f877804672aed10f323c14d0cf1f5a305b59db0d Mon Sep 17 00:00:00 2001 From: Anish-Hs Date: Mon, 29 Jul 2024 11:32:57 +0200 Subject: [PATCH 1/8] Printing functions for testing outputs --- src/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index faae9e3..4fc0cfc 100644 --- a/src/utils.py +++ b/src/utils.py @@ -103,4 +103,6 @@ def return_random_number() -> int: float ''' - return np.random.randint(0, 100) \ No newline at end of file + return np.random.randint(0, 100) +print(return_random_number()) +print(return_hexadecimal(return_random_number())) \ No newline at end of file From dbadf86b6cb5d868bd50bd31e5881b5724174b40 Mon Sep 17 00:00:00 2001 From: Anish-Hs Date: Mon, 29 Jul 2024 11:45:58 +0200 Subject: [PATCH 2/8] Updated the return_random_number --- src/utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/utils.py b/src/utils.py index 4fc0cfc..18548c2 100644 --- a/src/utils.py +++ b/src/utils.py @@ -91,7 +91,7 @@ def return_hexadecimal(a: int) -> float: return hex(a) -def return_random_number() -> int: +def return_random_number(a: int, b:int) -> int: ''' ... @@ -103,6 +103,4 @@ def return_random_number() -> int: float ''' - return np.random.randint(0, 100) -print(return_random_number()) -print(return_hexadecimal(return_random_number())) \ No newline at end of file + return np.random.randint(a, b) \ No newline at end of file From b5477bcc0f02b1fa18b63352086cb248e642cf83 Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:50:13 +0200 Subject: [PATCH 3/8] Update utils.py I fixed the issue #5 and #3 --- src/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils.py b/src/utils.py index faae9e3..bfed943 100644 --- a/src/utils.py +++ b/src/utils.py @@ -41,7 +41,8 @@ def divide(a: float, b: float) -> float: Returns: float ''' - return a / b + if b!=0: + return a / b def modulo(a: int, b: int): ''' @@ -103,4 +104,4 @@ def return_random_number() -> int: float ''' - return np.random.randint(0, 100) \ No newline at end of file + return np.random.randint(0, 100) From 0b4a6f67b365006c61abb26c9bc6bbc1034d0803 Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 13:54:51 +0200 Subject: [PATCH 4/8] Update utils.py I add a print line that says b can't be zero --- src/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils.py b/src/utils.py index bfed943..c716ebe 100644 --- a/src/utils.py +++ b/src/utils.py @@ -41,6 +41,7 @@ def divide(a: float, b: float) -> float: Returns: float ''' + print("b shouldn't be zero") if b!=0: return a / b From d6ecfb09427004892ee21d45cea63ba6460e4c94 Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:13:01 +0200 Subject: [PATCH 5/8] Update utils.py I moved the print into the condition block --- src/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index c716ebe..e073f33 100644 --- a/src/utils.py +++ b/src/utils.py @@ -41,8 +41,9 @@ def divide(a: float, b: float) -> float: Returns: float ''' - print("b shouldn't be zero") + if b!=0: + print("b shouldn't be zero") return a / b def modulo(a: int, b: int): From 5387673b3c0f1a6e3ae4529dda900a685967461a Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:20:08 +0200 Subject: [PATCH 6/8] Update utils.py I resolved the conflict with rand region --- src/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index e073f33..473aa1a 100644 --- a/src/utils.py +++ b/src/utils.py @@ -106,4 +106,4 @@ def return_random_number() -> int: float ''' - return np.random.randint(0, 100) + return np.random.randint(a,b) From cfa05c691b8e046cbcf48c7d61746498ee135335 Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:25:23 +0200 Subject: [PATCH 7/8] Update utils.py add a space before b --- src/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index 473aa1a..2aab6f6 100644 --- a/src/utils.py +++ b/src/utils.py @@ -106,4 +106,4 @@ def return_random_number() -> int: float ''' - return np.random.randint(a,b) + return np.random.randint(a, b) From 2c873c85b92dacf32946682513f8124d230b4950 Mon Sep 17 00:00:00 2001 From: anishhs001 <108971115+anishhs001@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:33:19 +0200 Subject: [PATCH 8/8] Update utils.py --- src/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index 2aab6f6..9ddfe09 100644 --- a/src/utils.py +++ b/src/utils.py @@ -43,8 +43,9 @@ def divide(a: float, b: float) -> float: ''' if b!=0: - print("b shouldn't be zero") return a / b + else: + print("b shouldn't be zero") def modulo(a: int, b: int): '''