Need Help for Quadratic formula on python
<p>I just started learning Python in school, here is my code for the quadratic formula solver. Problem is on line 4.</p>

<pre><code>a=int(input('a= ')) # A-stvis mnishvnelobis micema
b=int(input('b= ')) # B-stvis mnishvnelobis micema
c=int(input('c= ')) # C-stvis mnishvenlobis micema
int(a)*(x2)+int(b)*x+c=0
d=(-b2)-4*a*c
x1=-b+(d**(1/2))
x2=-b-(d**(1/2))
</code></pre>

<pre><code>from math import sqrt

a = int(input('a= ')) # A-stvis mnishvnelobis micema
b = int(input('b= ')) # B-stvis mnishvnelobis micema
c = int(input('c= ')) # C-stvis mnishvenlobis micema
d = b**2 - 4*a*c
x1 = (-b - sqrt(d))/2
x2 = (-b + sqrt(d))/2

print("x1 =", x1)
print("x2 =", x2)
</code></pre>

<p>Your equation is not needed, and python doesn't understand it. You can comment it if you want.</p>

<p>try and use the square root (<code>sqrt</code>) instead of exponentiation (<code>**</code>)</p>

python math formula quadratic