def fact(n):
    if n < 0: return 'undefined'
    if n <= 1: return 1
    return n * fact(n-1)

for i in range(-1, 7): 
    print("{}! = {}".format(i, fact(i)))

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: