In Scala, an underscore may be used to create a partially applied version of an infix operator using placeholder syntax. For example, `(_ * 3)` is a function that multiplies its input by 3. With a bit of manipulation, this idea can be extended to work on any arbitrary expression.
Create an value/object named `x` that acts as a placeholder in an arithmetic expression. The placeholder should support the four basic integer arithmetic operations: addition, subtraction, multiplication, and integral (floor) division. When the expression with placeholders is called, it should fill the placeholders in the expression from left to right (regardless of operator precedence) with the values it is given.
Here are a few examples:
```
calling (x + 3)       with [1]   gives 1 + 3               = 4
calling (10 - x)      with [4]   gives 10 - 4              = 6
calling (x + 2 * x)   with [1 3] gives 1 + 2 * 3   = 1 + 6 = 7
calling ((x + 2) * x) with [1 3] gives (1 + 2) * 3 = 3 * 3 = 9
calling (4 * (x / 2)) with [5]   gives 4 * (5 / 2) = 4 * 2 = 8
```
All inputs and outputs to/from the expression will be integer types. All expressions tested in this kata will be valid, i.e. there will be no division by zero and the number of values passed in will always be the same as the number of placeholders.
Note: `eval` and `exec` are disabled
# a skeleton class with required operators provided for convenience
# feel free to use another approach
import operator


def placeholdify(other):
    if not isinstance(other, Placeholder):
        return Placeholder(lambda: other, 0)
    return other

def make_bin_op(op):
    def __op__(self, other):
        other = placeholdify(other)
        return Placeholder(
            lambda *args: op(self(*args[:self.n]), other(*args[self.n:])),
            self.n + other.n
        )
    return __op__
            
        
def make_bin_rop(op):
    def __rop__(self, other):
        other = placeholdify(other)
        return Placeholder(
            lambda *args: op(other(*args[:other.n]), self(*args[other.n:])),
            self.n + other.n
        )
    return __rop__


class Placeholder:
    def __init__(self, f, n):
        self.f = f
        self.n = n
    def __call__(self, *args):
        return self.f(*args)
    __add__ = make_bin_op(operator.add)
    __sub__ = make_bin_op(operator.sub)
    __mul__ = make_bin_op(operator.mul)
    __floordiv__ = make_bin_op(operator.floordiv)
    __radd__ = make_bin_rop(operator.add)
    __rsub__ = make_bin_rop(operator.sub)
    __rmul__ = make_bin_rop(operator.mul)
    __rfloordiv__ = make_bin_rop(operator.floordiv)

x = Placeholder(lambda x: x, 1)
# a skeleton class with required operators provided for convenience
# feel free to use another approach
import operator


def placeholdify(other):
    if not isinstance(other, Placeholder):
        return Placeholder(lambda: other, 0)
    return other

def make_bin_op(op):
    def __op__(self, other):
        other = placeholdify(other)
        return Placeholder(
            lambda *args: op(self(*args[:self.n]), other(*args[self.n:])),
            self.n + other.n
        )
    return __op__
            
        
def make_bin_rop(op):
    def __rop__(self, other):
        other = placeholdify(other)
        return Placeholder(
            lambda *args: op(other(*args[:other.n]), self(*args[other.n:])),
            self.n + other.n
        )
    return __rop__


class Placeholder:
    def __init__(self, f, n):
        self.f = f
        self.n = n
    def __call__(self, *args):
        return self.f(*args)
    __add__ = make_bin_op(operator.add)
    __sub__ = make_bin_op(operator.sub)
    __mul__ = make_bin_op(operator.mul)
    __floordiv__ = make_bin_op(operator.floordiv)
    __radd__ = make_bin_rop(operator.add)
    __rsub__ = make_bin_rop(operator.sub)
    __rmul__ = make_bin_rop(operator.mul)
    __rfloordiv__ = make_bin_rop(operator.floordiv)

x = Placeholder(lambda x: x, 1)