# Iterative Table of Factorials # Neal Nelson 2007.10.07 def factTable(n): # print a table of factorials from 0 to n factVal = 1 for i in range(n+1): print i, factVal factVal = factVal * (i+1) def main(): n = input("Enter a positive integer: ") if (n < 0): print "Enter only positive integers" else: factTable(n) main()