PYTHON CODING
- waclaw_koscielniak
- Sep 13
- 1 min read
from functools import reduce
nums = [1, 2, 3, 4]
res = reduce(lambda x, y: x * y, nums, 2)
print(res)
nums.append(5)
res2 = reduce(lambda x, y: x + y, nums)
print(res2)
[Running] python3 -u "/Users/name/test/test247.py"
48
15
[Done] exited with code=0 in 0.065 seconds

Could you try to run it?