May 10, 2021 Python3
Python version 3.0, often referred to as Python 3000, or Py3k for short. T his is a larger upgrade than earlier versions of Python. In order not to bring too much burden, Python 3.0 was not designed with down-compatibility in consideration.
We can use the following commands to view the Python version we use:
python -V
The above commands are executed as follows:
Python 3.8.5
You can also go into Python's interactive programming mode to view the version:
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
1. For most programming languages, the first getting started programming code is "Hello World! " , the following code is to use Python to output "Hello World! ":
#!/usr/bin/python3
print("Hello, World!")
#!/usr/bin/python
Specify what interpreter to run the script and where the interpreter is located, if the interpreter is not installed in /usr/bin/directory, just change it to its directory, or more generally:
#!/usr/bin/env python
。
2. You can save the above code
hello.py
and execute the script file using the python command.
python hello.py
3. The output of the above commands is:
Hello, World!