# Difference between := and =

I've noticed that one can assign names to expression using either := or =.

• What is the difference between them?
• How to assign silently in both cases? Why does it changes?

+1 vote

':=' wants a mathematical expression on the right-hand side, and then converts that to an Ex object, before it assigns it to the python symbol on the left-hand side.

'=' wants a python object on the right-hand side.

So you can do

ex := A_{m n};


but you cannot do

ex = A_{m n};


because the right-hand side of the latter expression is not python.

To suppress output, use a ':' to terminate the line when you use the ':=' form, or simply nothing if you use the '=' construction.