title: Implementing recursion in Python
body: <p>I am currently working on recursion in Python but even though my process is correct I do not get my output format as I wanted.</p>
  
  <pre><code>def fibonacci(n):
  if n &lt;= 2:
      return 1
  else:
      return fibonacci(n-1) + fibonacci(n-2)
  
  def fibseries(N):
      if N &lt;= 1:
          return []
      return [fibseries(N-1),fibonacci(N-1)]
  a = fibseries(5)
  print a
  </code></pre>
  
  <p>This gives me the output : </p>
  
  <pre><code>[[[[[0], 1], 1], 2], 3]
  </code></pre>
  
  <p>but I want to get:</p>
  
  <pre><code>[0, 1, 1, 2, 3]
  </code></pre>
  
  <p>I need to understand the thinking process.</p>