One way to find the greatest common divisor (GCD) of a list of numbers is to use the built-in math.gcd()
function and the reduce() function from the functools module.
main.py102 chars6 lines
Alternatively, you can implement the GCD computation using recursion:
main.py216 chars11 lines
Finally, you can use a list comprehension to find the GCD of the list:
main.py79 chars3 lines
gistlibby LogSnag