> I finally have the gcd and lcm for any length list of > numbers. > ---------------------------------------------------------- > def __gcd__(a,b): > if b==0: > return a > return __gcd__(b,a%b) > > def gcd(list): > list.sort() > g=list[0] > for i in range(len(list)): > g=__gcd__(g,list[i]) > return g def gcd(lst): lst.sort() return reduce(__gcd__, lst) I think that should do the same thing? Alan G