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$ Commented Dec 9, 2020 at 7:00
  • $\begingroup$ OMG, you're such a genius! Thank you so much! Problem solved. $\endgroup$ Commented Dec 9, 2020 at 7:11

1 Answer 1

1
$\begingroup$

TreeForm[ToExpression @ test] Thanks to @kglr

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.