Learning Python

John Gordon gordon at panix.com
Wed Aug 24 20:46:19 CEST 2011

In <770aff9e-0879-40f5-ac86-f5098b9fd764 at b9g2000prd.googlegroups.com> kangshufan at hotmail.com writes:

> Hi all
> could some one help me=EF=BC=9F
> there is a piece of code:

> def fib(x):
>     if x=3D=3D0 or x=3D=3D1: return 1
>     else: return fib(x-1) + fib(x-2)

> Could some one explain it for me? I can't understand how it works.

Reposting the exact same question doesn't help us answer it.  Perhaps you
could explain why the previous responses weren't helpful.

John Gordon                   A is for Amy, who fell down the stairs
gordon at panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

More information about the Python-list mailing list