Skip to content

Instantly share code, notes, and snippets.

@Zyst
Created January 6, 2016 08:53
Show Gist options
  • Save Zyst/4f2ec01f3a7fdecc0233 to your computer and use it in GitHub Desktop.
Save Zyst/4f2ec01f3a7fdecc0233 to your computer and use it in GitHub Desktop.
# Had to show a friend how Euc algorithm for GCD works real quick
def euc(m, n):
r = m % n
if (r != 0):
euc(n, r)
else:
return n
print("Euclid GCD is: " + str(euc(15, 5)))
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
>>> Euclid GCD is: 5
=> None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment