Skip to content

Instantly share code, notes, and snippets.

@bharathmuddada
Last active May 26, 2021 10:23
Show Gist options
  • Select an option

  • Save bharathmuddada/b2df8786fcf0d516da252776ee47c926 to your computer and use it in GitHub Desktop.

Select an option

Save bharathmuddada/b2df8786fcf0d516da252776ee47c926 to your computer and use it in GitHub Desktop.
LCM in python
a = int(input("Enter your number \n"))
b = int(input("Enter your number \n"))
res = max(a, b)
while res <= a * b:
if res % a == 0 and res % b == 0:
break
res += 1
print(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment