__Function composition__ is a mathematical operation that mainly presents itself in lambda calculus and computability. It is explained well [here](http://www.mathsisfun.com/sets/functions-composition.html), but this is my explanation, in simple mathematical notation:

```
f3 = compose( f1 f2 )
   Is equivalent to...
f3(a) = f1( f2( a ) )
```

Your task is to create a `compose` function to carry out this task, which will be passed two functions or lambdas. Ruby functions will be passed, and should return, either a proc or a lambda. Remember that the resulting composed function may be passed multiple arguments!

```python
compose(f , g)(x)
=> f( g( x ) )
```

This kata is not available in haskell; that would be too easy!

Difficulty: introductory

Starter code:

def compose(f,g):
	

Solutions:
def compose(f,g):
  return lambda *x: f(g(*x))

def pow(x, y):
  return x**y

# assuming python 3 where print is a function
printPow = compose(print, pow)
# compose would return
lambda *x: print(pow(*x))
# because f is bound to print and g is bound to pow.

printPow(2, 3)
# this would call the lambda with x bound to [2, 3]
# so that gives you the expression:
print(pow(*[2, 3]))
# or equivalently:
print(pow(2, 3))


def compose(f,g):
    return lambda *args: f( g(*args) )

def compose(f,g):
    # Compose the two functions here!
    def z(*arg,**kw):
      return f(g(*arg,**kw))
    return z

def compose(f,g):
    def composing(*args, **kwargs):
        return f(g(*args, **kwargs))
    return composing

def compose(f,g):
    # Compose the two functions here!
    def newfunc(*args):
      return f(g(*args))
    return newfunc


def compose(f,g):
    return lambda *a,**kw: f(g(*a, **kw))

def compose(f,g):
    def h(*args, **kwargs):
        return f(g(*args, **kwargs))
    return h

def compose(f,g):
  def inner(*args, **kwargs):
    return f(g(*args, **kwargs))
  return inner

def compose(f,g):
    return lambda *args, **kwargs: f(g(*args, **kwargs))

def compose(*func):
    return C(func)
    
class C:
    def __init__(self,func):
        self.func = list(func)[::-1]
        
    def __call__(self,*value):
        value = sum(value)  
        for f in self.func:
            value = f(value)
        return value