{1,1,1,-2,1,2} How acn I multiply the elements in the list using loops?
Asked
Active
Viewed 166 times
2 Answers
4
I wouldn't use a loop here, I would go with:
Times @@ {1, 1, 1, -2, 1, 2}
But if you really need a procedural approach use a For loop instead (even if it's probably not a good idea).
Fold[Times, {1, 1, 1, -2, 1, 2}]– Bob Hanlon Dec 26 '19 at 17:55