Ai
1 Star 0 Fork 1

jack2583/PythonExamples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
lcm.py 449 Bytes
一键复制 编辑 原始数据 按行查看 历史
Punnatt Punnotok 提交于 2020-10-03 19:10 +08:00 . Added lcm.py
def lcm(x, y):
if x > y:
greater_number = x
else:
greater_number = y
while(True):
if((greater_number % x == 0) and (greater_number % y == 0)):
lcm = greater_number
break
greater_number += 1
return lcm
num_1 = int(input('Enter first number: '))
num_2 = int(input('Enter second number: '))
print('The L.C.M. of '+str(num_1)+' and '+str(num_2)+' is '+str(lcm(num_1,num_2)))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jack2583/pythonExamples.git
git@gitee.com:jack2583/pythonExamples.git
jack2583
pythonExamples
PythonExamples
master

搜索帮助