python · 2024-03-27
Python standard library's math module provides functions to calculate gcd math.gcd and lcm math.lcm.
math
math.gcd
math.lcm