began to formally enter the study of Python
First, the comment statement that is greeted:
Let 's start by understanding the Python environment variable comment statement:
# !/usr/bin/env python
I'm not talking about anything else. This is a little bit/usr/bin/env. This is your system's default Python environment variable. We know we can install a variety of Python in the system. But many versions of Python are for systems where the system environment variable reads into Python's program, such as when we execute the $ Python aa.py statement, we can see what version of Python the display results are, not that the higher the better, Not that you installed Python3 and python2.6 and then you have to do it with a higher version of the interpreter, but just look at the path. The python environment described by this path is the system environment. The advantage of this writing is that the file can be self-executing if it is given permission to execute the file later. such as $./AA.PYC uses this automatic execution method to automate Python for the system language.
Next is the second annotation language UTF8 encoding:
# -*-coding:utf-8-*-
This is only used in Python version 2 and automatically inherits the Python3 in the code. In fact, there are some more complex things, but this stage is first understood here.
Second, the definition of variables in Python:
A variable is a change of value; The format of a variable is a string that begins with a letter or underscore and contains only numbers, letters, and underscores. Moreover, many of the strings reserved in the system cannot be used as variables, although these reserved variables can still be assigned, but the result of the assignment can lead to unpredictable problems. The known system reservation keywords are as follows: "and", "as", assert "," Break "," class "," Continue "," Def "," Del "," Elif "," Else "," except "," exec "," finally " , ' for ', ' from ', ' global ', ' if ', ' import ', ' in ', ' is ', ' lambda ', ' not ', ' or ', ' pass ', ' print ', ' raise ', ' return ', ' Try ', ' While "," with "," yield "
Here is a detailed explanation of an old boy's senior teacher:
Continue to Practice Python Basics Summary (Comment | variable)