


When we execute x=y when, The changes of stack area and heap area in memory are as followsĢ. Give an example : Two variables x = 10、y = 20, Details are shown below , There are several variable names on the variable value in memory, and the binding reference count is just a few, As long as you don't 0 It's not garbage Garbage collection mechanism Definition of garbage data : As shown in the figure below, Such asįor spam data python A set of automatic recycling scheme has been developed When the amount of value data is very small If there are multiple variable names, you need to use Then it will point to the same addressĪ variable name can only point to one memory addressĪ memory address can have multiple variable names pointing to Print(id(name)) # A string of numbers Equivalent to memory address number Pi = 4 # Modification not supported Three elements of variable In other programming languages, there are real constants Once defined, it cannot be modified HOST = '127.0.0.1' # Generally, it is used more in the configuration file Stay python There is no real constant in We routinely treat all uppercase variables as constants Underline # Words are separated by underscoresĬonstant It is mainly used to record some constant states """JavaScript Hump body is recommended """Ģ. Little hump # The first letter is lowercase and the rest is uppercase ''' Variable name is the core No matter how long the variable is ''' Variable names must be named according to the name ( important ) Variable names cannot conflict with keywordsĤ. Variable name cannot start with a number, Underline is not recommended to start because it has special meaningģ. Variable names can only be numbers 、 Letter 、 Underline any incorrect )、_( Sure )、pwd_123_aaa( Sure )Ģ. After that, if you want to visit 18 Just pass the variable name age Just visit Naming conventions and styles # Naming specificationġ. take 18 The memory space address is bound to the variable name ageģ. Apply for a memory space in the memory space to store 18Ģ. When encountering assignment symbols, first look at the one on the right of the symbol, and then look at the one on the leftġ. Variable name Assignment symbol A variable's value That is, the amount of change Used to record a certain state of things ( The ability to imitate human memory )
PYCHARM GITHUB HOW TO
If a single line comment follows a line of code You need to leave two blank before you write pycharm It also provides the function of automating format code ctrl+alt+l code reformat code """ python Code specification >: PEP8 standard # How to quickly master With the help of pycharm Automated tips for before and after comparison Just remember every day Variable Variable # 1.

There must be a space between the alarm number and the comment text 2. How to use notes The way 1 Use alarm # Single-line comments The way 2 Use three quotes ( Single and double ) Multiline comment 3.pycharm Comment shortcuts ctrl + ? """ 1. What is annotation Comments are the interpretation of a piece of code Do not participate in the operation of the program It only serves as a reminder 2. Python Annotation syntax for """ Annotations are the mother of code !!!""" 1. Right click in the file content area and select run. Open file-settings-Editor-general- Check change font size with ctrl mouse wheel How to create python Script files Because the suffix of the file is used to identify the data characteristics inside the file We python Files also have a unique suffix. If not, continue as shown in the figure belowĬlick on file,settings,-Editor-color- schemeĬlick on file - settings - Project - Python Interpreter According to your own situationĢ、python The environment should be downloaded locallyĬlick the existing environment of this machine, If you are prompted NO interpr, Just click the second step I put the papers in D disc, Here's the picture You can set.
