Nice! Now, put this example on a webpage, with the function definition inside a <pre>, add a simple html tag so that it becomes <pre title="interpreter"> and it will be truly deserving of the epithet "crunchy" ;-)
More serious comment below. On 7/27/06, kirby urner <[EMAIL PROTECTED]> wrote: > We've many times visited the Fibonaccis on this list. > [snip] > > >>> def fibolater(a,b): > while True: > t = (yield a) > if t is not None: > a,b = t > a,b = b, a + b > > [snip] > > The punch line with the Phi-bonaccis is f.next()/f.next() -- and yes, > that's legal Python -- approaches 1/phi. Is the "order of operation" (i.e. first evaluated is the left-most one) always guaranteed to be that by Python? Or is it only guaranteed by the current CPython version?... I seem to recall, from many years in the past, that some language (C, I believe...) allowed statements like: i = 1 a = 2*i++ + i++ but that the order of execution (i.e. which "i++" is executed first) could not be guaranteed... (Quiz: what is "a" equal to? ) Anyone knows? (for Python I mean...) André _______________________________________________ Edu-sig mailing list [email protected] http://mail.python.org/mailman/listinfo/edu-sig
