In Python’s interpreter, we can use _ to get the last evaluated value. This could be useful if you don’t want to re-type the last evaluated value.
$ python3Python 3.7.3 (default, Oct 7 2019, 12:56:13)[GCC 8.3.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> 1 + 23>>> _3>>> 4 + _7>>>$ python3 Python 3.7.3 (default, Oct 7 2019, 12:56:13) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> 1 + 2 3 >>> _ 3 >>> 4 + _ 7 >>>$ python3 Python 3.7.3 (default, Oct 7 2019, 12:56:13) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> 1 + 2 3 >>> _ 3 >>> 4 + _ 7 >>>
Enter fullscreen mode Exit fullscreen mode
© 版权声明
THE END
暂无评论内容