input: Write a python function to solve a quadratic equation and return its roots.
  assert solve_quadratic(1, -3, 2) == (1.0, 2.0)
  assert solve_quadratic(1, 2, 1) == (-1.0, -1.0)
  assert solve_quadratic(1, 0, -1) == (-1.0, 1.0)
output: def solve_quadratic(a, b, c):
      import cmath
      d = b**2 - 4*a*c
      root1 = (-b + cmath.sqrt(d)) / (2*a)
      root2 = (-b - cmath.sqrt(d)) / (2*a)
      if d == 0:
          return (root1.real, root2.real)
      else:
          return (root1.real, root2.real)