Python the least common multiple

# 6, 8 least common muptiple

x=6
y=8
ret=[]                    # list is empty
for i in range(max(x, y), x*y+1):
    if i%x==0 and i%y==0:
        ret.append(i)
print(min(ret))          # 24

댓글

이 블로그의 인기 게시물

<배당주 투자> 배당주(은행) '22년 8월

은행주 - 배당주 투자 일기, 2022.07.04(월)

<배당주 투자> 지주사, '22년 8월