From 8f90bcd45a7a3a6c687816d7ac6034b41f04178b Mon Sep 17 00:00:00 2001 From: fd7794 Date: Tue, 6 Feb 2024 12:01:04 +0100 Subject: [PATCH] refactoring: simplified return statement for exponent 1 --- src/main/py/read_math_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/py/read_math_function.py b/src/main/py/read_math_function.py index d90b11a..35ad84b 100644 --- a/src/main/py/read_math_function.py +++ b/src/main/py/read_math_function.py @@ -86,7 +86,7 @@ def simplify_exponential_function(type, function): if new_exponent == 0: return [str(new_coefficient)] elif new_exponent == 1: - result = [f"{new_coefficient}x"] + return [f"{new_coefficient}x"] else: result = [f"{new_coefficient}x^{new_exponent}"] return result \ No newline at end of file