title: call 2 functions in a function
body: <p>The problem is as follows below:</p>
  
  <p>Write a function compose that takes two functions as argument, we call them <code>Fa</code> and <code>Fb</code>, and returns a function, <code>Fres</code>, that means that outdata from the other function is indata to the first, ex: <code>Fres(x) = Fa(Fb(x))</code>.
  run example:</p>
  
  <pre><code>&gt;&gt;&gt; def multiply_five(n):
  ... return n * 5
  ...
  &gt;&gt;&gt; def add_ten(x):
  ... return x + 10
  ...
  &gt;&gt;&gt; composition = compose(multiply_five, add_ten)
  &gt;&gt;&gt; composition(3)
  65
  &gt;&gt;&gt; another_composition = compose(add_ten, multiply_five)
  &gt;&gt;&gt; another_composition(3)
  25
  </code></pre>
  
  <p>So as I understand this if I send in 3 the function compose will take 3+10 = 13
  after that send that result into the multiply function it will do: 13*5 witch is 65.
  this is the code I've written so far:</p>
  
  <pre><code>def multiply_five(n):
      return n*5
  
  def add_ten(x):
      return x+10
  
  def compose(func1, func2):
      def comp(arg):
          return func2(arg)
      return func1(comp(arg))
  </code></pre>
  
  <p>I get compile error, and I've tried some different approaches:</p>
  
  <pre class="lang-none prettyprint-override"><code>Traceback (most recent call last):
    File "&lt;pyshell#3&gt;", line 1, in &lt;module&gt;
      composition = compose(multiply_five, add_ten)
    File "C:\Users\Jim\Desktop\tdp002\5h.py", line 10, in compose
      return func1(comp(arg))
  NameError: name 'arg' is not defined
  </code></pre>