>>> import math
#defining first function
>>> def f(a):
return a-math.sin(a)-math.pi/2
#defining second fuction
>>> def df(a):
return 1-math.cos(a)
#defining third function which uses above functions
>>> def alpha(a):
return a-f(a)/df(a)
How to write a code in which alpha(a) takes a starting value of a=2, and the solution of alpha(2) will become the input the next time. For eg: let's suppose alpha(2) comes to 2.39 , hence the next value would be alpha(2.39) and go on {upto 50 iterations}. Can somebody please help me a bit. thanks in advance.