加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Python Program to Find LCM 390 Bytes
一键复制 编辑 原始数据 按行查看 历史
paris00 提交于 2020-10-10 10:49 . Create Python Program to Find LCM
# Python Program to find the L.C.M. of two input number
def compute_lcm(x, y):
# choose the greater number
if x > y:
greater = x
else:
greater = y
while(True):
if((greater % x == 0) and (greater % y == 0)):
lcm = greater
break
greater += 1
return lcm
num1 = 54
num2 = 24
print("The L.C.M. is", compute_lcm(num1, num2))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化