A = 24
B = 18

a, b = A, B
while b != 0:
    a, b = b, a % b
gcd_value = a


lcm_value = (A * B) // gcd_value

print("GCD:", gcd_value)
print("LCM:", lcm_value)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: