title: python: return list method takes index as arguments
body: <p>I'm wondering if something pseudo coded below is possible:</p>
  
  <pre><code>def getLst(index = :):    
      lst = [1, 2, 3, 4, 5, 6, 7]
      return lst[index]
  
  
  print getLst()
  &gt;&gt; [1, 2, 3, 4, 5, 6, 7]
  
  print getLst(2)
  &gt;&gt; 3
  
  
  print getLst(2:-2)
  &gt;&gt; [3, 4, 5]
  </code></pre>
  
  <p>Obviously I'm getting a SyntaxError.</p>
  
  <p>The method is being used in at class for returning a private list.</p>
  
  <p>I know the example below is possible, and it might be more correctly (easier to read/understand the code), but since I've got the idea of doing the first example and it wasn't possible I got curioss of knowing how to make the first example work.</p>
  
  <pre><code>def getLst():    
      lst = [1, 2, 3, 4, 5, 6, 7]
      return lst
  
  
  print getLst()
  &gt;&gt; [1, 2, 3, 4, 5, 6, 7]
  
  print getLst()[2]
  &gt;&gt; 3
  
  print getLst()[2:-2]
  &gt;&gt; [3, 4, 5]
  </code></pre>