#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import timeit

def factorielle (n):
    # n doit être un entier naturel
    n = abs(int(n))
    # si n < 2 on retourne 1 puisque 0! = 1! = 1
    if n < 2: return 1
    # on utilise la récursivité (la fonction s'appelle elle-même)
    return n * factorielle(n - 1)
# end def

def test ():
    for n in range(10):
        print("{}! = {}".format(n, factorielle(n)))
    # end for
# end def

# test

print(timeit.timeit("test()", setup="from __main__ import test", number=1))
