Consider the following code:
Position[{1, 2, 3, 0}, Except[0]]
It returns me:
{{0}, {1}, {2}, {3}, {}}
Instead of what I would expect:
{{1}, {2}, {3}}
Why? In the documentation of Except it is written "Except[c] is a pattern object which represents any expression except one that matches c." Shouldn't it work as the way I expect?
expr = {1, 2, 3, 0}; pos = Position[expr, Except[0]]; Extract[expr, pos]
-- see if any of the extracted positions matches the pattern0
. Perhaps you wantPosition[{1, 2, 3, 0}, Except[0], 1, Heads -> False]
, if you want "members" of the list. $\endgroup$