Write a Python Program to print the LCM of Two Numbers


Topic: Write a Python Program to print the LCM of Two Numbers

Solution

def lcm(a,b):
    lcm.multiple=lcm.multiple+b
    if((lcm.multiple % a == 0) and (lcm.multiple % b == 0)):
        return lcm.multiple
    else:
        lcm(a, b)
    return lcm.multiple
lcm.multiple=0
a=4
b=7
if(a>b):
    LCM=lcm(b,a)
else:
    LCM=lcm(a,b)
print(LCM)



List all Python Programs