Jan-26-2018, 10:43 PM
(This post was last modified: Jan-26-2018, 10:43 PM by midnitetots12.)
def iterate(iterationnumber):
indented - f(x) = 2*x
indented - count = srange(iterationnumber)
indented - vals = [3]
indented - for i in count:
second indented - a = vals[i]
second indented - b = f(a)
vals.append(b)
return vals
So the problem is asking me to modify my code above to make the initial value in the iteration to be an input. Here it is 3 as seen above - could someone point me in the right direction?
indented - f(x) = 2*x
indented - count = srange(iterationnumber)
indented - vals = [3]
indented - for i in count:
second indented - a = vals[i]
second indented - b = f(a)
vals.append(b)
return vals
So the problem is asking me to modify my code above to make the initial value in the iteration to be an input. Here it is 3 as seen above - could someone point me in the right direction?