Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This question was also asked here. The answer is to use assignment:

sage: 1+1
sage: a = 1+1
sage: _ = 1+1

The last example is probably the best one to use most of the time, since "_" generally represents the result of the last evaluation (like the ANS button on a calculator). So if you assign to "_", then you're not "wasting" a variable. You'll see this trick used a lot in Sage's documentation.