The conversation between human and AI assistant.
[|Human|] Rewrite the code below to use recursion.
[|AI|] def factorial(n):
    if n <= 1:
        return 1
    else:
        return n * factorial(n-1)
[|Human|] 
Rewrite the code below to use recursion.