
Write Quadratic Equation
Quadratic Equation
may be expressed as a product
a(x-x1)(x-x2) = 0,where x1 and x2 are the solutions of equation, so called roots. After opening the brackets you receive well known form
a*x**2 + b*x + c = 0.This is what you should do in this mission. You have input list with integers - a, x1 [, x2]. If it has length 2, it means, x1 == x2: equation has two equal roots (one distinct root). Your function should return quadratic equation as a string. Pay attention to specific cases. Use Quadratic Formula Calculator for recheck. Good luck!
Input: List with 2-3 integers.
Output: String.
Examples:
assert quadr_equation([2, 4, 6]) == "2*x**2 - 20*x + 48 = 0" assert quadr_equation([-2, 4, 6]) == "-2*x**2 + 20*x - 48 = 0" assert quadr_equation([2,...
You should be an authorized user in order to see the full description and start solving this mission.