#!/usr/bin/python

def factorial (n):
    if isinstance(n, int):
        if n < 0:
            print 'Factorial undefined for negative integers'
            return None
        elif n == 0:
            return 1
        else: # n:int > 0
            return n*factorial(n-1)
    else: # n is not an integer
        print 'Factorial not defined for reals'
        return None

# Main program
print factorial (5)
print factorial (7)
