add iterate_f function and associated test func
This commit is contained in:
parent
c11156fb80
commit
51eab93255
2 changed files with 16 additions and 1 deletions
|
@ -2,3 +2,10 @@
|
|||
|
||||
def f(x, r):
|
||||
return r * x * (1-x)
|
||||
|
||||
def iterate_f(it, x, r):
|
||||
result = [x]
|
||||
for i in range(it):
|
||||
x = f(x, r)
|
||||
result.append(x)
|
||||
return result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue