Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How can I clear an assignment to a variable?

If I assign a symbolic expression to a variable, how do I clear the assignment as if I didn't assign anything to it in the first place?

For example,

sage: var('a,b')
(a, b)
sage: x=a+b
sage: x
a + b
sage: var(x)
a + b
sage: x
a + b
sage: x=x
sage: x
a + b

Here, I assigned a+b to x. But I can't 'unassign' it.

In Mathematica this can be done with Clear[x].

Thanks.