Skip to main content
7 of 7
added 10 characters in body; edited title
user64494
  • 29.1k
  • 4
  • 29
  • 56

How to efficiently Append a result of an operation on each element of a list to itself?

I'm looking for the best function to apply the product of the last two elements of sublist elements to each element:

Example:

(*Input:*)
 {{x1, y1, z1}, {x2, y2, z2}, ...}  

(*Desired output:*)
{{x1, y1, z1, y1 z1}, {x2, y2, z2, y2 z2}, ...}  

I know I could just use a Do loop with an index k and do it element by element with AppendTo, but I guess there is a faster method.