title: How to reverse last N elements of list in python
body: <p>Suppose I have a list:</p>
  
  <pre><code>&gt;&gt;&gt; numbers = list(range(1, 15))
  
  &gt;&gt;&gt; numbers
  
  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
  </code></pre>
  
  <p>I need reverse last 10 element only using slice notation</p>
  
  <p>At first, I try just slice w/o reverse</p>
  
  <pre><code>&gt;&gt;&gt; numbers[-10:]
  
  [5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
  </code></pre>
  
  <p>Then:</p>
  
  <p><code>&gt;&gt;&gt; numbers[-10::-1]</code></p>
  
  <p>I expected  <code>[14, 13, 12, 11, 10, 9, 8, 7, 6, 5]</code></p>
  
  <p>but got <code>[5, 4, 3, 2, 1]</code>.</p>
  
  <p>I can solve the problem like this:</p>
  
  <p><code>numbers[-10:][::-1]</code></p>
  
  <p>and everything OK</p>
  
  <p><code>[14, 13, 12, 11, 10, 9, 8, 7, 6, 5]</code></p>
  
  <p>But I wondering why  <code>numbers[-10::-1]</code> doesn't work as expected in my case and if there a way to get the right result by one slice?</p>