as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
create a function for calculating factorials.
user
def calculatefactorial(n: int) -> int: 
    '''returns the factorial of n (n!)

    parameters:
        n (int): the number to calculate the factorial for.

    returns:
        int: the factorial of n (n!)
    '''
    # base case: 0! = 1
    if n == 0: 
        return 1
    # recursive case: n! = n * (n - 1)!
    else: 
        return n * calculatefactorial(n-1)
assistant