From 5066fe695d9cd3afaebb16b2fb8a516df77b02ae Mon Sep 17 00:00:00 2001 From: fdai7764 Date: Sat, 20 Jan 2024 12:49:32 +0100 Subject: [PATCH] refactoring: Avoided Duplication of Code in Function multiplyFractions 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 cb32529..674bf11 100644 --- a/src/main/py/fractions.py +++ b/src/main/py/fractions.py @@ -26,8 +26,8 @@ def addFractions(num1, denom1, num2, denom2): return reduceFraction(result_num, denom1) def multiplyFractions(num1, denom1, num2, denom2): - result_num = num1 * num2 - result_denom = denom1 * denom2 + result_num = multiply(num1, num2) + result_denom = multiply(denom1, denom2) return reduceFraction(result_num, result_denom) def divideFractions(num1, denom1, num2, denom2):