
from fractions import gcd
from functools import reduce

MAXIMUM = 20


def compute(maximum=MAXIMUM):
    """Compute the LCM of all integers from 1 to `maximum`."""

    return int(reduce(lambda x, y: (x*y)/gcd(x, y), range(1, maximum + 1)))


from functools import reduce

MAXIMUM = 20


def gcd(num1, num2):
    """Return greatest common divisor using Euclid's Algorithm."""
    while num2:
        num1, num2 = num2, num1 % num2
    return num1


def lcm(num1, num2):
    """Return lowest common multiple."""
    return num1 * num2 // gcd(num1, num2)


def lcmm(*args):
    """Return LCM of args."""
    return reduce(lcm, args)


def compute(maximum=MAXIMUM):
    """Compute the LCM of all integers from 1 to `maximum`."""

    return lcmm(*range(1, maximum + 1))

Replace deprecated fractions.gcd with Euclid's Algorithm
Replace deprecated fractions.gcd with Euclid's Algorithm

  
- from fractions import gcd
  from functools import reduce
  
  MAXIMUM = 20
  
  
+ def gcd(num1, num2):
+     """Return greatest common divisor using Euclid's Algorithm."""
+     while num2:
+         num1, num2 = num2, num1 % num2
+     return num1
+ 
+ 
+ def lcm(num1, num2):
+     """Return lowest common multiple."""
+     return num1 * num2 // gcd(num1, num2)
+ 
+ 
+ def lcmm(*args):
+     """Return LCM of args."""
+     return reduce(lcm, args)
+ 
+ 
  def compute(maximum=MAXIMUM):
      """Compute the LCM of all integers from 1 to `maximum`."""
  
-     return int(reduce(lambda x, y: (x*y)/gcd(x, y), range(1, maximum + 1)))
+     return lcmm(*range(1, maximum + 1))
  
Replace deprecated fractions.gcd with Euclid's Algorithm
## Code Before:

from fractions import gcd
from functools import reduce

MAXIMUM = 20


def compute(maximum=MAXIMUM):
    """Compute the LCM of all integers from 1 to `maximum`."""

    return int(reduce(lambda x, y: (x*y)/gcd(x, y), range(1, maximum + 1)))

## Instruction:
Replace deprecated fractions.gcd with Euclid's Algorithm
## Code After:

from functools import reduce

MAXIMUM = 20


def gcd(num1, num2):
    """Return greatest common divisor using Euclid's Algorithm."""
    while num2:
        num1, num2 = num2, num1 % num2
    return num1


def lcm(num1, num2):
    """Return lowest common multiple."""
    return num1 * num2 // gcd(num1, num2)


def lcmm(*args):
    """Return LCM of args."""
    return reduce(lcm, args)


def compute(maximum=MAXIMUM):
    """Compute the LCM of all integers from 1 to `maximum`."""

    return lcmm(*range(1, maximum + 1))
