Browse Source

refactoring: simplified addition of "+0" in extract_constant

master
fd7794 11 months ago
parent
commit
bdfe9658bf
  1. 2
      src/main/py/read_math_function.py

2
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"]

Loading…
Cancel
Save