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 an algorithm to find the greatest common divisor for two positive integers.
user
"""
create an algorithm to find the greatest common divisor for two positive integers.
"""

def gcd(a, b): 
    # base case 
    if a == 0: 
        return b 
          
    return gcd(b%a, a) 


# driver program to test above function 
a, b = 20, 8
gcd(a, b) # prints 4
assistant