python knowledge sentiment

1. For the parameters of the function and the function of
the objective function of which lies in a package python data, we only need to define the function of the interface (parameter of the function) to the calling function may be implemented, we will call functions necessary to consider the internal function complex logic, like directly. Function is the core concept in programming languages, is close to the essence of the concept, we must understand thoroughly.
A function of the parameters can be divided into several categories. They were positional parameters, default parameters, variable parameters, keyword parameters, named keyword arguments. My understanding is that we can express these types of parameters from the data type passed into the function. For positional parameters, namely the incoming and call parameters are in accordance with the position parameter to the incoming. For the default parameters, that is, when the parameters defined functions to achieve parameter assignment. For variable parameters, compared with the incoming list or turple, incoming parameter is a variable, you can pass 0, 1, 100 and so on, as long as the pass is a list or turple can, of course, the simple elegance of python may even cause you to pass multiple parameters like internal function automatically combined into a List or turple. For keyword arguments, it requires incoming dic, dictionary type is a combination of key-value from the internal use of a hash algorithm that can quickly identify internal dic value according to the Key you give. Named keyword argument is passed dic variable type, but keyword arguments, we defined the key values that must be passed in the value of key parameters define the key values of a good argument.
2. Data type
python data types include integer, floating point numbers, strings, tuples, dictionaries, lists, etc. Data types in any language is the core concept, at the time a lot of time writing code code logic is not a problem, but do not determine the type of data, apply for granted.
Integer, that is the common sense integer, float, decimal mathematics is the range of values in python without these two, but too big python appear as inf. For tuples, it can be understood as a collection of a bunch of data, and the list is, except that the list is constant, and tuples can be changed. python in an immutable object really just a copy yourself when assigned to a variable, and point to a variable. For the dictionary, such as in the form of Key: Value.
3. Syntax
python grammar is relatively simple, indented code representing blocks, typically default to 4 space indentation. As a glue language, which we need to call the library, the code needs to be indicated in the front with Import.
4. Object-Oriented
be honest, I have not used object-oriented, but python is called object-oriented language, I think the idea of a designer in the design of this language is object-oriented. Everything object data variable is an object. Very fine Si fear, has three characteristics of object-oriented, data encapsulation, inheritance, polymorphism.
For data package, I feel this is a similar function that can be inherited from the parent class, without concern for how to achieve. Inheritance that subclasses can inherit all the features of the parent class. Polymorphism means is that they can also write a subclass method to override the parent class method inherited, so there will be a polymorphism. Object-oriented thinking is so great, I think it reduces the amount of code that lets programmers from a more human point of view to consider the issue, instead of focusing on low-level details.
The cycle
python there while loops, for loops. for iterative loop can be called, for iterables, such as str, list, turple can be iterated in the loop we may also be added if, else, elif logic to determine to code.
6. recursive
recursive time really makes me sigh with recursive code is the simple tm, and with the tail recursion not to worry about stack overflow, a recursive function is to call the function inside.
7. emphasis on language features
Refers to language features are available in any programming language, such as variable definitions, arithmetic operations, for loops, while loops, function definition, function calls, recursion, the lambda, object-oriented, garbage collection, pointer arithmetic. These are the foundation, be sure to do some exercises for each knowledge points.
8. Write yourself
from write 'hello, world' Go ahead, write your own point things out on their own will be greatly improved, and remember more prison.
Cheap IS 9.talk, Show Me at The code
of Linus year that remark, linus twenties wrote the Linux kernel, the Linux kernel now running on the computer is still hundreds of millions of people, always speaks inexpensive, hands-on writing .
10. I am a rookie
I'm just in the way python entry-level rookie, but write some of their own feelings and experiences, are also considered to alert their own, hoping to before Chinese New Year, grab tickets to develop a program to write, if anyone interested develop together, welcome to contact me. Let's progress together. . . Thank you

Published 19 original articles · won praise 1 · views 3137

Guess you like

Origin blog.csdn.net/qq_41603639/article/details/84961380