Pages

Bangladeshi Blog

Friday, January 14, 2011

24. Small Factorials

code:
def f(n):
    if n == 0:
        return 1
    else:
        return n * f(n-1)

for t in range(0, input()):
    print "%d" % f(input())

# end of source code
Be Pythonic

No comments:

Post a Comment