ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 15 Jan 2011 07:44:57 +0100Hide the Outputhttps://ask.sagemath.org/question/7869/hide-the-output/I have just an other question.
Is it possible to hide the output from an expression especially in notebook mode? The ";" does not working, as I have seen.
Is there a way to do so?
Thanks.Fri, 14 Jan 2011 13:29:45 +0100https://ask.sagemath.org/question/7869/hide-the-output/Answer by stanislav for <p>I have just an other question.</p>
<p>Is it possible to hide the output from an expression especially in notebook mode? The ";" does not working, as I have seen.</p>
<p>Is there a way to do so?</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/7869/hide-the-output/?answer=11975#post-id-11975Thank you for quick response. I will use the assignment to the _ variable.Sat, 15 Jan 2011 07:44:57 +0100https://ask.sagemath.org/question/7869/hide-the-output/?answer=11975#post-id-11975Answer by Felix Lawrence for <p>I have just an other question.</p>
<p>Is it possible to hide the output from an expression especially in notebook mode? The ";" does not working, as I have seen.</p>
<p>Is there a way to do so?</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/7869/hide-the-output/?answer=11974#post-id-11974This question was also asked [here](http://ask.sagemath.org/question/292/suppressing-output-in-notebook). The answer is to use assignment:
sage: 1+1
2
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.Fri, 14 Jan 2011 21:27:22 +0100https://ask.sagemath.org/question/7869/hide-the-output/?answer=11974#post-id-11974