0
$\begingroup$

How do I multiply elements within a list?

list = {{1}, {2, 3}, {4, 5, 6}, {7}, {8,9}}

Desired output:

{1, 6, 120, 7, 72}
| improve this question | | | | |
$\endgroup$
6
$\begingroup$

or type:

Apply[Times, list, {1}]

This is less elegant than the shorthand Times @@@ list but shows how Times can be applied to different levelspecs.

| improve this answer | | | | |
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.