From bdfe9658bf288fba0f91bb9760ab2f684770bc94 Mon Sep 17 00:00:00 2001 From: fd7794 Date: Tue, 6 Feb 2024 12:55:13 +0100 Subject: [PATCH] refactoring: simplified addition of "+0" in extract_constant --- 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 f4b5e84..29bbc7e 100644 --- a/src/main/py/read_math_function.py +++ b/src/main/py/read_math_function.py @@ -74,7 +74,7 @@ def simplify_easy_math_function(type, function): def extract_constant(function): coefficient, constant = function.split('x', 1) if 'x' in function else (function, '') if constant == "": - constant = constant + "+0" + constant += "+0" constant = constant.lstrip("+") return [constant, f"{coefficient}x"]