+ 1
Does anyone know how to fix this quadratic formula:
a=int(input()) b=int(input()) c=int(input()) print((-b+sqrt((b**2)-4*a*c))/2*a) print((-b-sqrt((b**2)-4*a*c))/2*a)
5 Answers
+ 3
You need to import math module for sqrt() method to work.
import math
print(math.sqrt(9))
+ 2
Because of the operators precedence.
Add this
.../(2*a))
+ 2
Thank you
+ 1
Simba that worked but it's giving me wrong values, do you know why?