Sep-01-2017, 01:39 PM
I want to write a program that lets the user provide an expression "on the fly" as in
expression = input ("Enter the expression")
for x in range (-10,10):
y = evaluate(expression(x))
print (y)
The idea is that I want to evaluate a user-supplied expression without having to change the source code of my program. Does Python have such a function or library? Maybe something n sympy?
Thanks - John Mycroft
expression = input ("Enter the expression")
for x in range (-10,10):
y = evaluate(expression(x))
print (y)
The idea is that I want to evaluate a user-supplied expression without having to change the source code of my program. Does Python have such a function or library? Maybe something n sympy?
Thanks - John Mycroft