Python variable identifier

A variable

Python in the process variables need not be declared variable assignment variable is declared and defined process

Variables created in memory, including the identification of variables, variable names and data

Each variable must be assigned before use, this variable will be created after variable assignment

Format: variable name = value Note: there must be a space on both sides of the equal sign

Equal sign (=) to the left is a variable name

Equal sign (=) is the right value stored in the variable

Equal sign (=) is used to assign

E.g:

number1 = 1

number2 = 0.99

name = "heroes"

 

Multiple variable assignment:

Variable Variable 1 = 2 = 3 = the value of the variable

Variable 1, variable 2, 3 variable = value 1, value 2 and value 3

 

2, the identifier

Python is a variable name, the function name, class name identifiers belong

(1) In Python, identified by letters, underscore (_) and digits

(2) the identifier is the characters can be letters or underscore (_), can not begin with a number

(3) the identifier is case-sensitive

(4) Python identifier must be unique in keyword

Python method Keyword View:

import keyword

keyword.kwlist

 

Guess you like

Origin www.cnblogs.com/keepkeep/p/11546218.html