[Edu-sig] Crunchy Fibonaccis

2006-07-27 Thread kirby urner
We've many times visited the Fibonaccis on this list. In the general case, we start with any two numbers (the seed pair) and add them to get the next in series, and so on, always adding the most recent two to get the next in line. Obviously, the Python generator is perfect for this, as it

Re: [Edu-sig] Crunchy Fibonaccis

2006-07-27 Thread Andre Roberge
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

Re: [Edu-sig] Crunchy Fibonaccis

2006-07-27 Thread kirby urner
(Quiz: what is a equal to? ) Anyone knows? (for Python I mean...) André I believe it's indigenous behavior, not unique to CPython. Also: a, b = b, a is legal in Python (no need for a temp). Kirby ___ Edu-sig mailing list Edu-sig@python.org

[Edu-sig] digits of pi

2006-07-27 Thread Michel Paul
When a student first sees Long integer capabilities a question often is How many digits of pi can it show? There's a slight disappointment when they find out that though there's a Long integer, there is no Long decimal. I would like to be able to show them a good way to compute a list of an

Re: [Edu-sig] Crunchy Fibonaccis

2006-07-27 Thread Tim Peters
[Andre Roberge] 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?... It's definitely Guido's /intent/ that left to right be strictly followed in all Python implementations,

Re: [Edu-sig] digits of pi

2006-07-27 Thread Tim Peters
[Michel Paul] When a student first sees Long integer capabilities a question often is How many digits of pi can it show? There's a slight disappointment when they find out that though there's a Long integer, there is no Long decimal. The newish `decimal` module has user-settable