I would like to use the mathematical_operation as entry argument for function, so the user can enter any mathematical_operation to receive result. Was thinking that something like that might work with default arguments :
mathematical_operation = input()
def fun(a=1, b=1, c=1, mathematical_operation=a*(x**2)+b*x+c):
x = np.linspace(-1,1,10)
y = (lambda a,b,c: mathematical_operation)(a,b,c)
print(x)
print(y)
return y
fun(mathematical_operation = a*(x**2)+b*x+c)
However it gives error:
Traceback (most recent call last):
File "C:\Users\Documents\Python\test.py", line 38, in <module>
def fun(a = 1, b = 1, c = 1, equation = a*(x**2)+b*x+c):
NameError: name 'a' is not defined