<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def factorial(n):
 """ Returns the factorial of n. """

    f = 1
    while (n > 0):
        f = f * n
        n = n - 1
    return f