I tried it,but eventually I wrote a program for more than 30 lines.So, I looked for solution on geeksforgeeks,
def findLCM(a, b):
lar = max(a, b)
small = min(a, b)
i = lar
while(1) :
if (i % small == 0):
return i
i += lar
Can anyone explain me the logic behind 'i += lar' I hope I was clear with the question. I'm welcome to any suggestions that are reasonably simple since I'm a beginner. Thank You