Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
match case sympy expand solution in 3rd party category for Write Quadratic Equation by Phil15
from sympy.abc import x
def quadr_equation(data: list[int]) -> str:
match data:
case (a, x1, x2):
p = a * (x - x1) * (x - x2)
case (a, x1):
p = a * (x - x1) ** 2
case _:
raise ValueError
return f'{p.expand()} = 0'
Aug. 21, 2022