Basic knowledge of Python

Source: Internet
Author: User

The Python interpreter executes the program procedure:

1. Start python interpreter a program to take files from hard disk to memory

2. Read the C:\test.py content from the hard disk into memory (this step is the same as the text editor)

3. The text editor reads into memory and the Python also executes the code that reads into the memory.

If you want to permanently save the code, you need to use the file .

If you want to debug a program, you need to use interactive mode.

Variable:

Change: The core is changing

Quantity: Measurement, measurement, expression is a state

Level = 0

Level = 1

Definition of variable: variable name = variable Value

Variable definition rules:

1. Variable names can only be any combination of letters, numbers, or underscores

2. The first character of a variable name cannot be a number

3. Individual keywords cannot be used to take variable names.

Changes to variables:

Garbage collection:values that are not bound in Python are recycled.

The reference count of the value or the name of the variable that is bound on the body is 0, and thePython interpreter is recycled periodically.

Delete simply deletes a binding relationship.

ID (variable name) memory address

Type (variable name)

The contents of the Print (variable name) value

Determine if the identity of two values is the same:

NAME1 is Name

IS: The ID is compared , as long as the ID, the other parts are the same.

Features of Python:

The length is not very long, there is a decimal pool,

Specifically for these decimals as the ID address.

= ID operation

= = Value Assignment operation

Some things in the program cannot be changed.

For example:

Constants: Constant Amount

There is no specific way to make a constant in Python, usually with an uppercase variable name,

There is only one hint effect.

Program Interaction:How Python interacts with the user.

The purpose of interaction: to simulate the server-side interaction with the user's connection

Input (' input ') for interactive

Ps:

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

Basic knowledge of Python

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.