1
$\begingroup$

I want to use the expression enter by the user and form the Tree, so I did TreeForm[test] as the picture show but it's not working. But if I do it manually, it works. enter image description here

Can anyone explain to me why this happens and how can I fix it?

$\endgroup$
2
  • $\begingroup$ try TreeForm[ToExpression @ test] ? $\endgroup$
    – kglr
    Dec 9, 2020 at 7:00
  • $\begingroup$ OMG, you're such a genius! Thank you so much! Problem solved. $\endgroup$
    – David
    Dec 9, 2020 at 7:11

1 Answer 1

1
$\begingroup$

TreeForm[ToExpression @ test] Thanks to @kglr

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.