MCPcopy Create free account
hub / github.com/geekcomputers/Python / compute_lcm

Function compute_lcm

finding LCM.py:4–17  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

2
3
4def compute_lcm(x, y):
5 # choose the greater number
6 if x > y:
7 greater = x
8 else:
9 greater = y
10
11 while True:
12 if (greater % x == 0) and (greater % y == 0):
13 lcm = greater
14 break
15 greater += 1
16
17 return lcm
18
19
20num1 = 54

Callers 1

finding LCM.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected