functools.reduce
Completed
Read a line of integers and print their product using functools.reduce.
Input
One line.
Output
The product.
Example
Input
1 2 3 4 5
Output
120
Editor
Python
Hints
reduce(f, items, start) combines items left to right.
Solution explanation
math.prod also exists, but reduce works for any combining operation.
Show solution
from functools import reduce
nums = map(int, input().split())
print(reduce(lambda a, b: a * b, nums, 1))