For example, if I have an expression like
x=True or True
if I evaluate in a shell, the result is True
print(x)
x=True
So now I want to convert a string or input for direct to this logical expression, for example
x=raw_input('Please give an expression:')
I know the expression is a string, so how do I convert this string to a boolean expression?
print(x)
x="True or True"
source
share