top of page
Search

PYTHON CODING

  • Writer: waclaw_koscielniak
    waclaw_koscielniak
  • Sep 29
  • 1 min read

from functools import reduce

nums = [2, 3, 4, 5]

product = reduce(lambda x, y: x * y, nums)

nums.remove(3)

s = reduce(lambda x, y: x + y, nums, 10)

print(product, s)


[Running] python3 -u "/Users/name/test/test197.py"

120 21

[Done] exited with code=0 in 0.062 seconds



Try to run it.
Try to run it.

















 
 
 

1 Comment


Guest
Sep 29

Try to verify it.

Like
bottom of page