Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Python assignment statement rules
Python assignment statement rules
Python assignment statement rules are as follows:

The assignment statement must be the attribute of the variable or object to the left of the assignment number (=), and cannot be an expression.

To the right of 1 and assignment number (=) are variable value, object attribute value, expression value, calculation formula value, function value, etc. They cannot be variables or objects.

2. Assignment statement is an expression statement composed of assignment expression and semicolon. Its general form is: variable = expression, and the function and characteristics of assignment statement are the same as assignment expression. This is one of the most commonly used statements in the program.

3. In the use of assignment statements, we should pay attention to the following points: Because the expression to the right of the assignment symbol "=" can also be an assignment expression. So the following formal variable = (variable = expression) holds, thus forming a nested situation.

The general form after expansion is: variable = variable = expression. For example, a=b=c=d=e=5, which is actually equivalent to e=5, d=e, c=d, b=c and a=b according to the right conjunction of assignment operators.

Introduction to Python:

Python was designed by Guido Van Rossum of the Netherlands Institute of Mathematics and Computer Science in the early 1990s as a substitute for a language called ABC. Python provides efficient high-level data structures and can also be used for simple and effective object-oriented programming.

Python's syntax and dynamic types, as well as the nature of explanatory language, make it a programming language for writing scripts and developing applications quickly on most platforms. With the continuous updating of the version and the addition of new language functions, it is gradually used for the development of independent large-scale projects.

Reference to the above content: Baidu Encyclopedia -—Python