May-25-2019, 12:55 PM
When i run this code python shell shows nothing
in '2.txt' 2 numbers " 21,53"
in '2.txt' 2 numbers " 21,53"
# least common multiple def lcm(a,b): with open('2.txt') as f: a, b = [int(x) for x in next(f).split(',')] array = [[int(x) for x in line.split(',')] for line in f] m = a*b while a != 0 and b != 0: if a > b: a %= b else: b %= a return m // (a+b) print("a=%d ; b=%d ; LCM=%d"%(a,b,lcm(a, b)))