From 6198b2359c7785b31bd67e16c7c25bba32268d2e Mon Sep 17 00:00:00 2001 From: Sara Nicoly Date: Fri, 30 Oct 2020 07:38:37 -0300 Subject: [PATCH] added smallest common multiple in python --- .../py/smallest-c-mul.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Mathematics/smallest common multiple/py/smallest-c-mul.py diff --git a/Mathematics/smallest common multiple/py/smallest-c-mul.py b/Mathematics/smallest common multiple/py/smallest-c-mul.py new file mode 100644 index 000000000..681739e03 --- /dev/null +++ b/Mathematics/smallest common multiple/py/smallest-c-mul.py @@ -0,0 +1,16 @@ +#Find the smallest common multiple of the given parameters that can be evenly divided by both + +num1 = int(input("Type an integer: ")) +num2 = int(input("Type another integer: ")) + +if num1 > num2: + x = num1 +else: + x = num2 + +for i in range(x): + aux = num1 * i + if (aux % num2) == 0: + mmc = aux + +print(mmc) \ No newline at end of file