be based on python:3.7.8
A variable is a box , It can hold all kinds of things . Packed with apples , When boxes work with other things , It's the apple ; Packed with pears , When working with something else , It is a pear .
Compiler language (JAVA、Dart etc. ) The variable of requires that the box be fixed , Those who hold fruit will hold fruit , If you want to pack pastry, just pack pastry , Assembly parts of assembly parts .
Explanatory language (python、javascript etc. ) Variables of do not require , Casually , What you like to put on . When it cooperates with fruit, use it as fruit ; When it cooperates with pasta, use it face to face .
A generalized variable is relative to a constant , A variable quantity . Variables are absolute , Constants are relative , There is no absolute constant .
From Zhihu : What do variables mean ?
messsage = "hello,world!"
number = 12;
_Name = " Zhang San ";
Zhang Mes = " I am a Chinese character variable ";
print(messsage);
print(number);
print(_Name);
print( Zhang Mes);
hello,world!
12
Zhang San
I am a Chinese character variable
Variable names are not recommended , Lowercase letters l, And number 0, because 1 and l,0 and o Easy to confuse ; Chinese characters are not recommended ;
Python 3.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import keyword
>>> keyword.kwlist
['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
>>>
'False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield'
python Syntax is not used to enforce definitions in Constant , in other words ,python In the definition of Constant It is essentially a variable . If you have to define Constant , Variable names must be all uppercase ;
From a normative point of view , By default, the constants are capitalized , Don't change its value ;
PI=3.1415;
print(PI)
PréfaceCe chapitre traite prin
Use pandas_profiling Th