Skip to main content
added 91 characters in body
Source Link
halirutan
  • 113.4k
  • 7
  • 266
  • 479

In[1]:= Position[{a, b, a, a, b, c, b}, b]If have the following command

Out[1]= {{2}, {5}, {7}}

Position[{a, b, a, a, b, c, b}, b]

(* Out[1]= {{2}, {5}, {7}} *)

HowIs it possible to get the output become likeonly a sequence of values instead of this one? Out[2]= 2, 5list, 7like

Out[2]= 2, 5, 7

I want it because I wantI'm interested in the values only and don't need the list structure.

Thank you

In[1]:= Position[{a, b, a, a, b, c, b}, b]

Out[1]= {{2}, {5}, {7}}

How to get the output become like this one? Out[2]= 2, 5, 7

I want it because I want the values only.

Thank you

If have the following command

Position[{a, b, a, a, b, c, b}, b]

(* Out[1]= {{2}, {5}, {7}} *)

Is it possible to get only a sequence of values instead of this list, like

Out[2]= 2, 5, 7

I'm interested in the values only and don't need the list structure.

Source Link

Get value only from Position

In[1]:= Position[{a, b, a, a, b, c, b}, b]

Out[1]= {{2}, {5}, {7}}

How to get the output become like this one? Out[2]= 2, 5, 7

I want it because I want the values only.

Thank you