**I am trying to make a function return the results of a Quadratic equation, But I can't figure out how to print the solutions as fraction. Please help me! **
def cube_root(x):
return x**(1/3)
def Quadratic(a, b, c):
delta = (b**2)-4*a*c
if delta == 0:
x = (-b)/2*a
return f"This Quadratic equation has 1 solution: {x}"
else:
if delta < 0 :
return "This Quadratic equation has no solutions: "
else:
x1 = ((-b)-cube_root(delta))/2*a
x2 = ((-b)+cube_root(delta))/2*a
return f"This Quadratic equation has 2 solutions: {x1} & {x2}"
print(Quadratic(12, 0, -1))