I get boolean expression like below :
string = '!True && !(True || False || True)' I know eval('1+2') returns 3. But when I am executing eval(string) it is throwing me error as in invalid syntax.
Is there any other way I can execute the above expression?
&&and||- you wantand,or,not.!Trueis not valid Python. The!operator doesn't exist in Python, usenotinstead.