in this post it is explained, how to use the result of a previous code execution by using
_
, e.g.
>>> 5+5
10
>>> _
10
>>> _ + 5
15
>>> _
15
The question is inspired by languages like Mathematica, where you can easily call the result of the last line.
I notices, that this example does not work when you execute it all at ones, e.g.
5+5
_+5
Is there a corresponing way to calculate without defining new variables each time?
Edit:
The role of _
has been understood. The question is, wether there is (can be/ can't be) a corresponding statement that reads the result of the last line within the same execution.