from fractions import gcd D=[1,2,5,7,10,14,35,70]# a = 2# #a and b belong to D b = 14# def lcm(*numbers): """Return lowest common multiple.""" def lcm(a, b): return (a * b) // gcd(a, b) return reduce(lcm, numbers, 1) print "lcm(2,14) : ",lcm(2,14)
lcm(2,14) : 14