Need sympy function for log2(x) capable of being used in sympy.solve
问题 I need to accept user input in the form of a string, parse it into a sympy expression, and then solve for a variable. Most of the user's allowed functions match sympy functions except for log2(x) which is equivalent to sympy's log(x, 2). I've tried the method of defining a python function that returns the sympy function as mentioned here. I've also tried using defining a sympy function using lambda. Both methods work for getting the value of the expression after substituting variables for