preface

Python is a language that stands for simple ideas, and its syntax is relatively simple and easy to learn. However, it would be a mistake to underestimate the subtlety and depth of Python syntax.

If it can be thoroughly mastered and flexibly used in actual combat, it will make the code more refined and efficient, and also greatly improve the code B lattice, making it look more sophisticated and read more elegant.

Today, I would like to share with you a copy of “Python Basic Grammar Summary Notes Word version” summarized by my senior in the process of self-study. The content is concise and comprehensive, which is very useful for beginners. I would like to review it from time to time to strengthen memory and sort out knowledge difficulties. Because it is an editable file, you can also add the knowledge points you need to become their own complete grammar notes.

Understand the python

Python identifiers 3. Reserved characters in Python 4. Indentation and multi-line statement writing 5

Python variable types

1. Variable assignment in Python 2. Data types in Python 3. List 4.

Python operator.

1. Arithmetic operator 2. Comparison operator 3. Python assignment operator 4. Python bit operator 6. Python member operator 7. Python identity operator (which determines the object to reference) 8

Python statements

1. Conditional statement 2. Loop statement

Python date and time

Obtain the timestamp 2. Obtain the time 3. Obtain the formatting time 4. Gets the Calendar for a month 6. functions and attributes for the Time and Calendar modules 7. Other modules that can handle time

Python functions

1.Python function definition 2. Object creation 3. Mutable and immutable objects 4. Parameter passing of modifiable object and immutable object 5. Parameter use 6 when calling function. Anonymous functions (created using lambda 7. Variable scope

Python module

Namespace and scope 3. Find all module names, function names, and variable names (dir() function) in the module 4. Look at the global and local variables namespace 5.reload () function

Python I/O functions (not just file reads and writes)

1. Read keyboard input 2. Open and close reading and writing files 3. File OS (Python module for handling files and directories)

Exception handling in Python

Exception type 2. Exception handling 3. Set exceptions (used for bug modification and error checking) 4. Create your own exception types for common exception reuse

Python built-in functions

Python Object Oriented

1. Introduction to Object-oriented technology 2. Create classes 3. Create instance objects 4. Class inheritance 7. Operator overloading 8. Class private properties and methods 9. Single underscore, double underscore, header and tail double underscore

For those who need the full python Syntax summary, click here for free!