I wrote the following code:
simplification = parse_expr(str_expression, evaluate=True)
expression = parse_expr(str_expression, evaluate=False)
if expression == simplification:
msg = "Couldn't simplify!"
else:
msg = "Simplified:"
I thought that if the expression is the same whether or not it has been evaluated, that must mean that it's already as simplified as it can be. But for some reason, for
str_expression = "s+5"
I get that this expression is false:
expression == simplification
Does anybody know why? How do I fix this?
Thank you in advance.