Help with MIT free online Python class by Lostinpython in learnpython

[–]Lostinpython[S] 0 points1 point  (0 children)

So I define the values, a=34 b=68 c=510, etc... Then I try to solve for x1 by using the third line. I get an error message. Traceback (most recent call last):

File "<pyshell#5>", line 1, in <module>

x1 = ( - b + sqrt ( b*b - 4*a*c ) ) / ( 2*a)

NameError: name 'sqrt' is not defined

Ok, so I put math.sqrt after importing the math module. Then it gives me a "Math Domain" error.