News for hackers. Stuff that matters.
Re:Evolution of a Python programmer by alxv on Friday January 29, 2010 @02:21PM (#1087289)
Functional programmer:

    import operator
    def factorial(n):
        return reduce(operator.mul, xrange(1, n+1), 1)
    print factorial(6)
Cutting-edge programmer:

   import math
   print(math.factorial(6))
Re:Evolution of a Python programmer by ozataman on Friday January 29, 2010 @04:18PM (#1087581)
reduce is pretty much the same thing as foldl. The functional programmer is already included as "Expert Python Programmer"...
Re:Evolution of a Python programmer by Estragon on Friday January 29, 2010 @10:51PM (#1088191)
The difference is, the code given here actually works out of the box.
Re:Evolution of a Python programmer by brehaut on Friday January 29, 2010 @07:10PM (#1087927)
I believe this Gist is being updated as the thread unfolds.

ahem.

Re:Evolution of a Python programmer by gaius on Saturday January 30, 2010 @05:47AM (#1088505)
I would have done

    from math import factorial as fact
    print fact(6)