Can python find fibonacci series in a single line of code?

And then there's RomeRun romerun at romerun.com
Tue Nov 12 04:36:45 EST 2002


a_human_work at hotmail.com (Pittaya) wrote in message news:<fa61a3d8.0211110720.16a645f8 at posting.google.com>...
> My Perl-addicted friend shows me that he can find fibanicci series in
> a single line of code.
> 
> perl -le '$b=1; print $a+=$b while print $b+=$a'
> 
> can python do something like this?

No idea, however in parrot vm the code may look nearly like to this one:

        set I1,0
        set I2,1
James:  print I1
        print "\n"
        add I2,I2,I1
        print I2
        print "\n";
        add I1,I1,I2
        branch James

from http://www.perl.com/pub/a/2001/09/18/parrot.html?page=2



More information about the Python-list mailing list