title: Recursion and Tuples in Python
body: <p>I am trying to write two functions that take an integer and return a tuple. I can get very close to what would like to return, but what I am returning has multiple parenthesis within it. for example, I want rec_range(5) to return (0,1,2,3,4) instead of (((((0, 1), 2), 3), 4).</p>
  
  <p>Here are the two functions I am writing</p>
  
  <pre><code>def rec_range(n):
      '''Takes a natural number n and returns a tuple of numbers starting
         with 0 and ending before n.
         Int--&gt;Tuple'''
  
      if n == 0:
           return 
      if n == 1:
          return 0
      if n &gt;= 1:
          return rec_range(n-1),(n-1)
  
  def squares_tuple(n,m):
      '''Takes a natural numbers n and m and returns a tuple of the squares
         of all the natural numbers starting with n and ending with m-1.
         Int,Int--&gt;Tuple'''
  
      while n&lt;=m:
          return n * n, squares_tuple(n + 1, m)
  </code></pre>