top of page
Search

PYTHON CODING

  • Writer: waclaw_koscielniak
    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



Try to run it.
Try to run it.














 
 
 

1 Comment


Guest
Sep 13

Could you try to run it?

Like
bottom of page