def plus_minus(s):
    for t in itertools.product(['', '+', '-'], repeat=len(s) - 1):
        yield ''.join(itertools.chain.from_iterable(zip(s, t))) + s[-1]
Taking a string of numbers and inserting + and - operators