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
generate a code to check whether a given number is prime
user
def is_prime(num): 
    if num > 1: 
        for i in range(2,num): 
            if (num % i) == 0: 
                return false
        else: 
            return true 
    else: 
        return false
    
# driver code to test the function 
num = 5

if (is_prime(num)): 
    print(num, "is a prime number") 
else: 
    print(num, "is not a prime number")
assistant