You can use the gcd() function of Numpy to compute the greatest common divisor of numbers.
If you have only 2 numbers:
>>> import numpy as np>>> np.gcd(5,10)5>>> np.gcd(15,16)1
If you have more than 2 numbers:
>>> np.gcd.reduce([8,14,16])2>>> np.gcd.reduce([8,40,45])1