From 193c829491def4f8075c96e328160411dafce245 Mon Sep 17 00:00:00 2001 From: fdai7764 Date: Sat, 20 Jan 2024 12:42:18 +0100 Subject: [PATCH] refactoring: Avoided Duplication of Code in Function reduceFraction by utilizing the already implemented functions --- src/main/py/fractions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/py/fractions.py b/src/main/py/fractions.py index 397b9d6..1a7f800 100644 --- a/src/main/py/fractions.py +++ b/src/main/py/fractions.py @@ -9,8 +9,8 @@ def dec_to_frac(dec_number): def reduceFraction(num, denom): gcdOfFraction = gcd(num, denom) - num /= gcdOfFraction - denom /= gcdOfFraction + num = divide(num, gcdOfFraction) + denom = divide(denom, gcdOfFraction) return (num, denom) def addFractions(num1, denom1, num2, denom2):