How to convert String to Boolean Logic? [duplicate]

那年仲夏 提交于 2020-01-14 05:43:13

问题


I have sting input like:

12 == 21
(10 != 12) or (15 == 13)
True and (10 == 10)

And i need to return boolean value of this input. Can i convert it using exec() or bool()? I don't want to write big method to solve it .

来源:https://stackoverflow.com/questions/53675559/how-to-convert-string-to-boolean-logic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!