title: python:find a ascending/decreasing elements in a list without using loop
body: <p>Suppose I have a list, I need to find two lists in list 'a', in a increasing/decreasing order, respectively.</p>
  
  <pre><code>a=[4,2,6,5,2,6,9,7,10,1,2,1]
  </code></pre>
  
  <p>The output should be a list :</p>
  
  <pre><code>b=[4,6,9,10] # in an ascending order
  </code></pre>
  
  <p>and</p>
  
  <pre><code>c=[4,2,1] # in a decreasing order , c[-1] is the first '1' in list a, c[1] is the first '2' in list a.
  </code></pre>
  
  <p>Is there a possible way to do it without using loop (I have solved it using a loop)? As a have a large dataset, using loop would be slow. So I am looking for a faster way if possible. Thanks a lot.</p>