From d169d65961ee4e38f90e83ad11aebfceee31b3e7 Mon Sep 17 00:00:00 2001 From: fd7794 Date: Tue, 6 Feb 2024 12:18:53 +0100 Subject: [PATCH] added if not check for simplify_product_function --- src/main/py/read_math_function.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/py/read_math_function.py b/src/main/py/read_math_function.py index af796df..834f285 100644 --- a/src/main/py/read_math_function.py +++ b/src/main/py/read_math_function.py @@ -99,4 +99,6 @@ def simplify_product_function(type, function): result_coefficient = 1 result_variables = "" for term in terms: - simplified_term = simplify_easy_math_function("v", term.strip()) \ No newline at end of file + simplified_term = simplify_easy_math_function("v", term.strip()) + if not simplified_term or len(simplified_term) != 2: + return False \ No newline at end of file