title: function1 not returning conn variable
body: <pre><code>def function1():
      conn = sqlite3.connect('mydb.db')
      connection = conn.cursor()
  
      return conn, connection
  
  def function2(conn, connection):
      conn.execute("""
       INSERT INTO category
       (cat_name)
       VALUES (?) """, (cat,)
       )       
       conn.commit()
  
  def main():
      connection = function1()
      categories = function2(conn, connection)
  </code></pre>
  
  <p>It fails saying:</p>
  
  <pre><code>categories = function2(conn, connection)
  NameError: name 'conn' is not defined
  </code></pre>
  
  <p>Any idea why? Thank you</p>