title: Python 3: Functions dependent on other functions, missing parameter?
body: <p>I have two functions, the latter of which is dependent on the results of the first.
  They are both mathematical functions using floats.</p>
  
  <p>The gist of the two functions are:</p>
  
  <pre><code>def function1(a,aa,b,bb):
      # get result z from a and b
      # get error in result, zz, from raw errors, aa and bb
      print (z,zz)
  
  def function2(z,zz,c,cc):
      # get result x from z and c
      # get error in result, xx, from zz and cc
      print (x,xx)
  </code></pre>
  
  <p>With a, b, and c being measured variables defined outside of the functions
  With aa, bb, and c being the errors in the measured variables, also defined outside of the functions.</p>
  
  <p>After defining the functions, I write the following command:</p>
  
  <pre><code>function2(function1(a,aa,b,bb),c,cc)
  </code></pre>
  
  <p>I am hoping that function1 would produce two results (z, zz) and they would be accepted as the first two parameters of function2.</p>
  
  <p>Instead, I get the error "TypeError: function2() missing 1 required positional argument: 'cc'</p>
  
  <p>So I assume that function1 is only producing one result at the end. How do I fix this?</p>
  
  <p>Full code here: <a href="http://tinyurl.com/sof-typeerror" rel="nofollow">http://tinyurl.com/sof-typeerror</a></p>