计算两个数的最小公倍数python

python计算两个数的最小公倍数

def exe(x, y):
    if x > y:
        maxnum = x
    else:
        maxnum = y

    while True:
        if maxnum % x == 0 and maxnum % y == 0:
            num = maxnum
            break
        maxnum += 1
        
    return num

猜你喜欢

转载自blog.csdn.net/E_chos/article/details/111316362#comments_15917293