def factorial(*args):

    def fact(n):
        if n == 0:
            return 1
return n * fact(n - 1)
return [fact(a) for a in args]
Single implementation to cover both single and multiple values in Python?