Tsinghua professor retreated for 7 days and organized 137 pages of Python study notes. It is enough to read this article for a comprehensive summary

As one of the most popular programming languages ​​at the moment, Python has been popular from the past few years to the present, and there are even more trends. Not only has it attracted many people in the industry, but people outside the circle have also joined the camp of learning Python.

But when many friends are learning Python, they call out: It's too difficult, I can't learn it! So how should Python be learned? How to turn boring tutorial into easy to understand?

Today, I would like to share with you a copy of the Python study notes organized by the master. The 137-page super-comprehensive summary integrates a core knowledge point into one chapter, which is more organized and refined, and it is convenient for everyone to understand the difficulties of Python. It is very suitable for beginners.

collection method:

The Great God retreated for 7 days to organize! 137 pages of Python study notes, a comprehensive summary is enough to read this article

Table of contents

  • An Introduction to Python's Dynamic Type

  • number type

  • Set type

  • string

  • the list

  • tuple

  • general order

  • dictionary

  • document

  • Statements and Grammar

  • assignment statement

  • Print

  • if statement

number type

  • Python numeric constants

  • Numeric type conversion

  • In mixed-type expressions, Python first converts the operand to the type of the most complex operand

  • Python allows to perform consecutive comparisons, and the comparison chain can be arbitrarily long

  • Python's division x/y is different in Python3 and Python2.7

  • Python supports many built-in functions and built-in modules for number processing

general order

  • Python's general sequences include: strings, lists, tuples

  • Python's general sequence operations include: index operation, slice operation, sequence addition, sequence multiplication

  • Three analytical expressions

  • copy of the sequence

Functions and Scope

  • Python functions are written by chef statements. In Python, functions are also an object type.

  • Function parameters do not have any type constraints, nor does the return type

  • Python function definition statement

  • Functions are just object types, function names are just variable names, they have nothing special

  • Code inside a function subject is not run until the function is called. Variable names inside functions are not resolved until the function is actually executed

  • Variables can be defined in three different places, corresponding to three different scopes

  • scope rules

  • Variable Name Lookup Rules

Advanced usage of modules

  • By default, a Python module exports all variable names for values ​​attached to the top level of its module file, and there are no private variable names. All private data is more of a convention than a syntactic constraint

  • When the file is executed as a top-level program file, the module's name attribute is set to the string main. If the file is imported, the name attribute becomes the name of the file name minus the suffix

  • import and from can use as extension to resolve variable name conflicts in this way

The Great God retreated for 7 days to organize! 137 pages of Python study notes, a comprehensive summary is enough to read this one . Python is one of the most popular programming languages ​​at the moment. Not only attracted many people in the industry, https://mp.weixin.qq.com/s/0lW-IY1MMXXTKXocDfqPCw

Guess you like

Origin blog.csdn.net/m0_68507761/article/details/125041510