Python3学习第一天
Python3版本说明
Python 的 3.0 版本,常被称为 Python 3000,或简称 Py3k。相对于 Python 的早期版本,这是一个较大的升级。为了不带入过多的累赘,Python 3.0 在设计的时候没有考虑向下兼容。 这里用的是Deepin系统(Windows 使用 win+R 调出 cmd 运行框)。打开终端,输入python --version 结果如下Python 3.7.3
进入Python的交互式编程模式
直接输入python就可以了
$ python
Python 3.7.3
(default, Mar 27 2019, 22:11:17
)
[GCC 7.3.0
] :: Anaconda, Inc. on linux
Type
"help",
"copyright",
"credits" or
"license" for more information.
>>>
第一个Python3.x程序
使用touch命令新建一个文件hello.py输入以下内容,
print
("Hello, World!")
使用python命令执行脚本,$ python3 hello.py 输出结果为Hello, World!