Python 3 course

python3

Python of 3.0 edition , It is often called Python 3000, Or abbreviation Py3k. be relative to Python Earlier versions of , This is a big upgrade . In order not to bring in too much burden ,Python 3.0 Downward compatibility was not considered in the design .

Python Introduction and installation tutorial we are in Python 2.X Version of the tutorial It has been introduced in , I won't repeat here .

You can also click Python2.x And 3​​.x Version differences To see the difference between the two .

This tutorial is mainly aimed at Python 3.x Version of learning , If you use Python 2.x Please move to Python 2.X Version of the tutorial .

It is officially announced that ,2020 year 1 month 1 day , stop it Python 2 Updates for .


see Python edition

We can in the command window (Windows use win+R call out cmd Run box ) Use the following command to view the Python edition :

python -V
 Or 
python --version

The execution result of the above command is as follows :

Python 3.3.2

You can also enter Python Interactive programming mode , View version :

Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 

first Python3.x Program

For most programming languages , The first entry programming code is "Hello World!", The following code is used Python output "Hello World!":

example (Python 3.0+)

#!/usr/bin/python3 print ( " Hello, World! " )

Run instance »

You can save the above code in hello.py File and use python Command executes the script file .

$ python3 hello.py

The output result of the above command is :

Hello, World!

Related content :

Python 3.6.3 Chinese Manual

Python 2.X Version of the tutorial