Skip to content
Snippets Groups Projects
Commit 4a07d490 authored by Taddeus Kroes's avatar Taddeus Kroes
Browse files

gcd() now takes an arbitrary number of arguments

parent e8143dfb
No related branches found
No related tags found
No related merge requests found
def gcd(a, b):
def _gcd(a, b):
while b:
a, b = b, a % b
return a
def gcd(*args):
return reduce(_gcd, args)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment