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
write an api to find the next prime number
user
def next_prime(n):
    '''
    returns the next prime number after the number n
    inputs:
        n (int): the number that the api should start from
    outputs:
        the next prime number
    '''
    num = n + 1
    while true:
        for i in range(2, num):
            if num % i == 0:
                num += 1
                break
        else:
            return num
assistant