[Chicago] Python Tutorial 4.6 function fib()

Jon Sudlow jsudlow at gmail.com
Sun Jan 6 22:10:59 CET 2008


Like I said, their are slicker solutions like recursion. Nice fib in five
lines.The next time someone asks me  about  a fib sequence I'll be fully
loaded ;)

Thanks,
Jon

On Jan 6, 2008 10:26 AM, sheila miguez <shekay at pobox.com> wrote:

> On Jan 5, 2008 10:47 PM, Patrick O'Hara <pohara at virtualmotors.com> wrote:
> > uh you did not answer the question
> > why did the def fib(n):
> > fail to work
> > on python
> > or my MacBookPro w/ Leopard
>
> Ted answered your question.
>
>
> what you typed here is wrong
> > >    a,b = b, a*b
>
> Ted corrected it
> >    a,b = b, a+b
>
> So, the reason the function you typed from the tutorial didn't work is
> that you didn't type it correctly.
>
> reread
>
> http://docs.python.org/tut/node6.html#SECTION006600000000000000000
>
>
>
> --
> sheila
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago
>



-- 
Jon Sudlow
3225 Foster Avenue
221 Sohlberg Hall
C.P.O 2224
Chicago, Il  60625
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/chicago/attachments/20080106/1117444c/attachment.htm 


More information about the Chicago mailing list