I am making a script where you can input a, b and c into the quadratic formula and it will give you the answer.
It says that b is not defined when I run it.
from cmath import sqrt
qf = lambda a, b, c: (-b-cmath.sqrt((b**2) - (4*a*c)))/(2*a), (-b+cmath.sqrt((b**2) - (4*a*c)))/(2*a)
a, b, c = input('Enter a, b and c with spaces in between the values \n').split()
a = float(a) ; b = float(b) ; c = float(c)
Print(qf(a, b,c)
Traceback (most recent call last): File "/storage/emulated/0/Download/.last_tmp.py", line 2, in qf = lambda a, b, c: (-b-cmath.sqrt((b2) - (4*a*c)))/(2*a), (-b+cmath.sqrt((b2) - (4*a*c)))/(2*a) NameError: name 'b' is not defined