-
-
Save amankharwal/d03e91807dded957e446ee99c1289e9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def least_common_multiple(a, b): | |
if a > b: | |
greater = a | |
elif b > a: | |
greater = b | |
while(True): | |
if ((greater % a == 0) and (greater % b == 0)): | |
lcm = greater | |
break | |
greater = greater + 1 | |
return lcm | |
print(least_common_multiple(10, 12)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment