You can download this code by clicking the button below.
This code is now available for download.
This function calculates the Greatest Common Divisor (GCD) of two integers using the Euclidean algorithm.
Technology Stack : Built-in functions (% for modulus operation; while loop for iteration)
Code Type : Function
Code Difficulty :
def arial(arg1, arg2):
"""
计算两个数的最大公约数(GCD)。
"""
while arg2:
arg1, arg2 = arg2, arg1 % arg2
return arg1