I extracted a mathematical string from text e-g s = "a&(b|c)"
and I want to use eval(s)
but before I do, I have to assign values to the variables something like:
a, b, c = somefuction()
how do I do this dynamically like
r = re.findall("\w+", s)
r[0], r[1], r[2] = somefunction()
and then pass back these value to the variables and use eval()
on it.
My end output should give me True of False based on the values of a,b,c