1 | initial version |
This question was also asked here. 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.