Python Basic notes (i)

Source: Internet
Author: User

Python interpreter process for executing a python program: Python3 C:\test.py
1. Start the Python interpreter (in memory)
2. Read the C:\test.py content from the hard disk into memory (this step is the same as the text editor)
3. Execute code that reads into memory

If you want to permanently save your code, you need to use the file
If you want to debug your code, you need to use an interactive approach


Variable definition rules

Variable names can only be any combination of letters, numbers, or underscores
The first character of a variable name cannot be a number
The following keywords cannot be declared as variable names [' and ', ' as ', ' assert ', ' Break ', ' class ', ' Continue ', ' Def ', ' del ', ' elif ', ' Else ', ' except ', ' exec ', ' Finall Y ', ' for ', ' from ', ' global ', ' if ', ' import ', ' in ', ' was ', ' lambda ', ' not ', ' or ', ' pass ', ' print ', ' raise ', ' return ', ' Try ', ' While ', ' with ', ' yield ']

Variable
Define a variable, the stored data is a variable value
Variable name and variable value are just a binding relationship
The variable name itself does not have the ability to store values

The value of the reference count or the value of the body is bound to a variable named 0, the Python interpreter will periodically recycle their

Three important components of a variable definition
1 ID 2 type 3.value (value)


ID (variable name) Enter can get variable in ID
Type (variable name) Enter to get the types of variables
Directly enter the variable name return to get the value of the variable

Variable 1 is variable 2 is used to determine whether the IP of two variables is the same
Variable 1 = = Variable 2 = = To determine whether the value of two variables is the same

Two variables with the same value, when the number is equal to the hour, the IP is the same
IP is different when the value is large


Constants: Constant Amount
There is no specific way to define constants in Python, usually with variable names all capitalized to represent constants

Python Basic notes (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.