17 lines
267 B
Python
17 lines
267 B
Python
def gcd(a: int, b: int) -> int:
|
|
result = []
|
|
for i in range(1, min(a, b) + 1):
|
|
if a % i == 0 and b % i == 0:
|
|
result.append(i)
|
|
else:
|
|
continue
|
|
return max(result)
|
|
|
|
if __name__ == "__main__":
|
|
print(gcd(18, 24))
|
|
|
|
|
|
|
|
|
|
|