Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
from math import prod
But, I haven't found built-in to get the product of the list.
Can you give the cue, please.
Wow, thanks)
You don't need to turn that generator expression into a list, you could replace the
[]
with()
to theoretically improve performance.Or you could just not do any
i for i in
stuff and just make the second argument the list itself.You could also pass a
1
as a third argument tofunctools.reduce
to simplify this a little.Instead of using a
lambda
, you could import from operator.Finally, instead of a reduce, you can just use a certain built-in to get the product of the list.