I want to convert this code, which is to solve the quadratic equation, into a lambda function
from math import sqrt
def Equation(a,b,c):
r = b ** 2 - 4 * a * c
if r > 0:
num_roots = 2
x1 = (((-b) + sqrt(r)) / (2 * a))
x2 = (((-b) - sqrt(r)) / (2 * a))
print("There are 2 roots: %f and %f" % (x1, x2))
elif r == 0:
num_roots = 1
x = (-b) / 2 * a
print("There is one root: ", x)
else:
num_roots = 0
print("No roots, discriminant < 0.")
Equation(1,2,0)