Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 5bc8981

Browse files
authored
Add files via upload
1 parent fc967a9 commit 5bc8981

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

5_div.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
import fractions
3+
4+
5+
def lcm(n):
6+
ans = 1
7+
for i in range(1, n + 1):
8+
ans = (ans * i)/fractions.gcd(ans, i)
9+
return ans
10+
11+
n = 20
12+
print lcm(n)

0 commit comments

Comments
 (0)