# Task
Let's define a `parameter` of number `n` as the least common multiple (LCM) of the sum of its digits and their product.

Calculate the parameter of the given number `n`.

# Input/Output

`[input]` integer `n`

 A positive integer. It is guaranteed that no zero appears in `n`.

`[output]` an integer

 The parameter of the given number.

# Example

For `n = 22`, the output should be `4`.

Both the sum and the product of digits equal 4, and LCM(4, 4) = 4.

For `n = 1234`, the output should be `120`.

`1+2+3+4=10` and `1*2*3*4=24`, LCM(10,24)=120

Source: codewars | Difficulty: EASY
Tags: Ad-hoc

Starter code: def parameter(n):
	

Solutions:
from fractions import Decimal, gcd
from operator import mul
from functools import reduce
lcm = lambda a, b=1: a * b // gcd(a, b)

def parameter(n):
	digits = Decimal(n).as_tuple().digits
	return lcm(sum(digits), reduce(mul, digits))


from math import gcd

def parameter(n):
	(s, p) = (0, 1)
	for m in str(n):
		s += int(m)
		p *= int(m)
	return s * p / gcd(s, p)


from functools import reduce
from fractions import gcd

def parameter(n):
	n = [int(i) for i in str(n)]
	sum_ = reduce(lambda a, b: a + b, n)
	prod = reduce(lambda a, b: a * b, n)
	return sum_ * prod / gcd(sum_, prod)


import operator, functools

def parameter(n):
	ls = [int(i) for i in str(n)]
	m = functools.reduce(operator.mul, ls)
	s = sum(ls)
	return m * s / gcd(m, s)

def gcd(a, b):
	if not b:
		return a
	else:
		return gcd(b, a % b)


from fractions import gcd
from functools import reduce
from operator import mul

def parameter(n):
	digits = [int(d) for d in str(n)]
	product = reduce(mul, digits)
	total = sum(digits)
	return product * total / gcd(product, total)


parameter = lambda n: (lambda a, b: a * b // __import__('fractions').gcd(a, b))(*[eval(c.join(str(n))) for c in '+*'])


from functools import reduce
gcd = lambda a, b: gcd(b, a % b) if b else a
lcm = lambda a, b: a / gcd(a, b) * b
parameter = lambda n: (lambda n: lcm(sum(n), reduce(lambda a, b: a * b, n, 1)))([int(e) for e in str(n)])


from math import gcd

def parameter(n):
	total = sum((int(x) for x in str(n)))
	product = 1
	for num in str(n):
		product *= int(num)
	return total * product // gcd(total, product)


import math

def parameter(n):
	d = [int(x) for x in str(n)]
	s = sum(d)
	p = 1
	for i in range(0, len(d)):
		p *= d[i]
	g = math.gcd(s, p)
	l = s * p // g
	return l


from functools import reduce

def digit_sum(n):
	return sum((int(i) for i in str(n)))

def digit_product(n):
	return reduce(lambda a, b: a * int(b), str(n), 1)

def gcd(x, y):
	while y != 0:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y / gcd(x, y)

def parameter(n):
	return lcm(digit_sum(n), digit_product(n))