title: Can't figure this function composition code
body: <p>I wrote a code that gets n functions and composites them together. If the function doesnt recieve any input it returns the "x" which we called the lambda functions with.(example- compose()(3) # will return 3)
  this is my code, i simply cant seem to see the problem:</p>
  
  <pre><code>def compose(*funcs):
      if len(funcs)==0:
          return lambda x: x
      else:
          for i in funcs[-1:0:-1]:
  
              return lambda x: funcs[0](funcs[i](x))
  </code></pre>