@Navin : Thanks in case #2: "reduce(lcm2, mylist)" works fine
On Fri, Oct 30, 2009 at 5:58 AM, Navin Kabra <navin.ka...@gmail.com> wrote: > > Something like this should work: > > def lcm2(a, b): > > return a*b/fractions.gcd(a,b) > > > > def lcm(mylist): > > return reduce(lcm2, mylist) > > > > Actually, this probably should be "reduce(lcm2, mylist, 1)" > > navin. > _______________________________________________ > BangPypers mailing list > BangPypers@python.org > http://mail.python.org/mailman/listinfo/bangpypers > _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers