0

just a simple question for now I guess:

I have a list:

list={{1, 2, 1}, {1, 10, 1}}

I simply want to Drop the last element of the two entries of the list, that is the 1's at the end. I tried it this way:

Table[Drop[list[[x]], -1], {x, 1, Length[list]}]

but I don't like it this way. I feel I'm always stuck on using this Table-function,and I'm pretty sure this can be done in a much easier way

Kuba
  • 136,707
  • 13
  • 279
  • 740
holistic
  • 2,975
  • 15
  • 37

1 Answers1

4

How about

Most/@yourList

This should perhaps be the shortest way to do it.

Per Alexandersson
  • 2,469
  • 15
  • 19