I need a program to take mathematical expression as input and evaluate its value in a range

后端 未结 0 1869
既然无缘
既然无缘 2021-02-08 13:28
xvals = linspace(a, b, 1001)
expr = //string taken as input
yvals=list()
for x in xvals:
    y=eval(expr)
    yvals.append(y)
plt.plot(xvals, yvals)

Thi

相关标签:
回答
  • 消灭零回复
提交回复
热议问题