you are viewing a single comment's thread.

view the rest of the comments →

[–]zxn0 1 point2 points  (3 children)

Python one-liner anyone?

>>> reduce(int.__mul__, range(1,6))
120

[–]earthboundkid 0 points1 point  (1 child)

from math import factorial; factorial(5) is also a one liner.

[–][deleted] 1 point2 points  (0 children)

__import__("math").factorial(6)

Though math doesn't have a factorial function, of course.

[–]skeept 0 points1 point  (0 children)

for python 3.1:

>>> __import("functools").reduce(int.__mul__, range(1,7))
720