The greatest common divisor and the least common multiple
Write code · Medium · §7.6 Nested loops and the first math helper
Store the greatest common divisor of the two numbers in gcd and their least common multiple in lcm. The least common multiple, an integer, is the product of the two numbers divided by their greatest common divisor.
Starter code
a = 18
b = 30Solve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.