Skip to content

Instantly share code, notes, and snippets.

View ramachandrajr's full-sized avatar

Ramachandra Junior ramachandrajr

View GitHub Profile
@ramachandrajr
ramachandrajr / lcm.py
Created March 16, 2017 05:10
Python LCM Algorithm
def gcd(a, b):
"""Return greatest common divisor using euclid's Algorithm
."""
# Run while b is not equal to zero
while b:
a, b = b, a % b
print "a: %d, b: %d." % (a, b)
print "=" * 10
return a