c'mon... only for integer numbers (and not even checking)? What about
float?

Anyway, he is also missing:

storage = {}
def memoize(f):
    def g(x):
        if x in storage:
            y = strorage[x]
        else:
            y = storage[x] = f(x)
        return y
    return g

@memoize
def factorial(x): return x in (0,1) and 1 or x*factorial(x-1)



On Dec 29, 8:21 am, Bruno Rocha <[email protected]> wrote:
> 'Enterprise Programmer' is the best part of it. LOL
>
> 2010/12/29 Bruno Rocha <[email protected]>
>
>
>
> >http://dis.4chan.org/read/prog/1180084983/
>
> > --
>
> > Bruno Rocha
> >http://about.me/rochacbruno/bio
>
> --
>
> Bruno Rochahttp://about.me/rochacbruno/bio

Reply via email to