Skip to content

Commit f4c3e9f

Browse files
committed
Added DOCSTRINGS, Wikipedia link, and whitespace
I added DOCSTRINGS and whitespace to make the code more readable and understandable.
1 parent 705eabd commit f4c3e9f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

maths/find_lcm.py

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
"""Find Least Common Multiple."""
2+
3+
# https://en.wikipedia.org/wiki/Least_common_multiple
4+
5+
16
def find_lcm(num_1, num_2):
7+
"""Find the LCM of two numbers."""
28
max = num_1 if num_1 > num_2 else num_2
39
lcm = max
410
while (True):
@@ -9,6 +15,7 @@ def find_lcm(num_1, num_2):
915

1016

1117
def main():
18+
"""Use test numbers to run the find_lcm algorithm."""
1219
num_1 = 12
1320
num_2 = 76
1421
print(find_lcm(num_1, num_2))

0 commit comments

Comments
 (0)