Python 3 Tutorial
The 3.0 version of Python, often referred to as Python 3000, or Py3k for short. This is a larger upgrade than the previous version of Python. In order not to introduce too much cumbersome, Python 3.0 was designed without considering backward compatibility.
View python version
We can use the following command to view the version of Python we use in the command window (Windows uses win+R to bring up the cmd run box):
python -V Span>
The above command execution results are as follows:
You can also enter Python's interactive programming mode to view the version:
Python 3.3.2 ( Span>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. >>>
The first Python 3.x program
For most programming languages, the first intro programming code is "Hello World!", the following code is to output "Hello World!" using Python:
Instance (Python 3.0+)
You can save the above code in the hello.py file and execute the script file using the python command.
$ python3 hello.py
The output of the above command is: