wheat 发表于 2018-8-4 11:07:35

python3 教程

python 3教程

查看Python版本
  我们可以使用一下命令来查看我们使用的Python版本:
  

python -V  

  以上命令执行结果如下:
  

python 3.3.2  

  你也可以进入python的交换式编程模式,查看版本:
  

Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) on win32  
Type "copyright", "credits" or "license()" for more information.
  

  

第一个Python3.x程序
  编程代码便是:“Hello World!”,以下代码使用Python输出“Hello World” :
  

实例(python 3.0+)  
# !/usr/bin/python3
  

  
print("Hello, World!");
  

  你可以将以上的代码保存在hello.py文件中使用python命令执行脚本文件。
  

$ python3 hello.py  

  以上命令输出结果为:
  

hello, world!
页: [1]
查看完整版本: python3 教程