在许多符号数学系统(例如Matlab或Mathematica)中,可以使用变量,例如Ans或,%以检索最后计算的值。Python Shell中有类似的功能吗?
Ans
%
下划线。
>>> 5+5 10 >>> _ 10 >>> _ + 5 15 >>> _ 15