I want to calculate the product sum of two lists using reduce() and a regular function.
The regular function to return the product is defined as:
def func(maturity, weight):
return maturity * weight
and the reduct function is like:
reduce(func, zip(terms, weights))
An error
"TypeError: can't multiply sequence by non-int of type 'tuple'"
then appears. Is there any way to pass the regular function instead of lambda to calculate the product sum of the two lists?