For a simple equation such as:
x = y + z
You can get a third variable if you bind the other two (i.e.: y = x - zand z = x - y). A simple way to put this in code:
def solve(args):
if 'x' not in args:
return args['y'] + args['z']
elif 'z' not in args:
return args['x'] - args['y']
elif 'y' not in args:
return args['x'] - args['z']
else:
raise SomeError
Obviously, I can take the equation, analyze it and simplify it to achieve the same effect. But I believe that I will reinvent the wheel. So where is my finished wheel?
source
share