I Don't exactly understand what you want to do but that might help:
from numpy import linspace, sin, cos, tan
import matplotlib.pyplot as plt
a = float(input('Enter x0: '))
b = float(input('Enter x1: '))
x = linspace(a, b, 1001)
for trig_func in [sin, cos]:
y = trig_func(x)
plt.title(f'{trig_func.__name__}(x)')
plt.plot(x, y)
plt.xlabel('x')
plt.ylabel('y')
plt.show()
Please explain how you try to implement eval function..
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…