How to produce Taylor Series of Exponential function?
I am trying to create a program, that ask no. Of terms and the value assigned from user and print result in a form of Taylor expansion. Currently, it has error and not working properly. My attempt # Taylor Series Expansion of Exponential Function. import math exp = math.e series = 1 pow = 1 y = 1 size = int(input("Enter number of terms.")) x = int(input("Enter any value. ")) real_val = exp**x print("") print("Real Value = ", real_val) # Define Power function. def Power(pow): pow = x**size return pow # Define Exponential Function. def Exp(y): for i in range(1, size+1): y = Power(i)/math.factorial(i) return y print("Final answer is ", y)