# fact.py # A program to calculate and print factorial values. # Name: # Date: # Lab 03 # Calculate and return the value of n! (that is, the factorial of n). def factorial(n): fact = 1 return fact # print a table of factorials def main(): count = int(input("How many rows should we calculate? ")) print("n n! n^2 2^n n^n") for k in range(1,count+1): bang = factorial(k) print(k, " ", bang, " ", k*k, " ", 2**k, " ", k**k)