Horje
lcm python Code Example
lcm math python library
from math import gcd
def lcm(a,b):
  return a*b/(gcd(a,b))
print(lcm(12,70))
//output: 420
lcm python
# Python program to find the L.C.M. of two input number

# This function computes GCD 
def compute_gcd(x, y):

   while(y):
       x, y = y, x % y
   return x

# This function computes LCM
def compute_lcm(x, y):
   lcm = (x*y)//compute_gcd(x,y)
   return lcm

num1 = 54
num2 = 24 

print("The L.C.M. is", compute_lcm(num1, num2))
python find lcm
def lcm(a, b):
        i = 1
        if a > b:
                c = a
                d = b
        else:
                c = b
                d = a
        while True:
                if ((c * i) / d).is_integer():
                        return c * i
                i += 1;




Python

Related
how to ask someone for their name in python Code Example how to ask someone for their name in python Code Example
my django template doesnt want to load the static file Code Example my django template doesnt want to load the static file Code Example
python remove duplicates from a list Code Example python remove duplicates from a list Code Example
np.random.float Code Example np.random.float Code Example
np.random.uniform Code Example np.random.uniform Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7