[Tutor] functions and iterations

Rufino Beniga rbeniga04 at gmail.com
Tue Nov 13 04:56:16 CET 2012


def IterateLogistic(x,r,n):
    for i in xrange(n):
        x = r*(1-x)
        if i = n:
            print x

I want this function to take in x and r which can be any two real numbers
and after a certain number of iterations (n), the function should print the
current state which is x. I tried this function and it doesn't do anything.
May you please tell me what i did wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121112/4af11d00/attachment.html>


More information about the Tutor mailing list