I am making a function on python3 that solves ax^2+bx+c so a quadratic equation
My code looks like this:
def quadratic(a, b, c):
return a*x**2 + b*x + c
But it wont let me do this because x is undefined. I want to take the argument x on a test code that looks like this:
def testQuadratic(a, b, c, x):
try:
return quadratic(a, b, c)(x)
except TypeError:
return None
Can anyone tell me how I can fix this? Thank you!!