The Python Oracle

What's the function like sum() but for multiplication? product()?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Lost Meadow

--

Chapters
00:00 Question
00:32 Accepted answer (Score 135)
02:23 Answer 2 (Score 233)
02:42 Answer 3 (Score 47)
02:55 Answer 4 (Score 43)
03:20 Thank you

--

Full question
https://stackoverflow.com/questions/5953...

Question links:
[sum()]: http://docs.python.org/library/functions...

Accepted answer links:
[math.prod()]: https://docs.python.org/3.8/library/math...
[rejected the idea]: http://bugs.python.org/issue1093
[reduce()]: https://docs.python.org/2.7/library/func...
[operator.mul()]: https://docs.python.org/3/library/operat...
[reduce()]: https://docs.python.org/3/library/functo...
[functools module]: https://docs.python.org/3/library/functo...
[math module]: https://docs.python.org/2.7/library/math...

Answer 2 links:
http://bugs.python.org/issue1093

Answer 3 links:
[prod()]: http://docs.scipy.org/doc/numpy/referenc...

Answer 4 links:
[here]: https://stackoverflow.com/questions/4938...
[Which Python module is suitable for data manipulation in a list?]: https://stackoverflow.com/questions/4938...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #product #builtin #pep

#avk47