Реализуйте функцию, используя библиотеку math (python)
def custom_function_1(x, n):
res = 0
for i in range(1, n + 1):
res += (math.pow(n + 2, x) + math.log10(x)) / (math.pow(x, 2) + 4 * n)
return res
pass
Ответы (1 шт):
Автор решения: T0xee.n17
→ Ссылка
def custom_function_1(x, n):
res = 1
for i in range(1, n + 1):
res *= (math.pow(n + 2, x) + math.log1p(x)) / (math.pow(x, 2) + 4 * n)
return res
Изменения:
math.log10 -> math.log1p (натуральный логарифм)
res += -> res *= (перемножение вместо сложения)
res = 0 -> res = 1
