Python early entry (the first week of article)

Python early entry
python is a kind of language?
Category programming language
programming language mainly from the following angles Category: compiled and interpreted, static and dynamic language language, strongly typed and weakly typed language definition language.

Compiled language and interpreted language differences
compiled language: the need to compile the source code by a compiler into machine code, the compiler is usually required (the compile) and links (link) two processes.

Converting the source code is compiled into machine code, the links are connected in series to generate executable machine code dependent libraries and modules;

The advantage is compiled only once, do not need to compile and run time, thus high efficiency, and can exist independently from the locale;

After compiling is a disadvantage if it is necessary to modify the whole module recompilation; compile time based on the corresponding machine code generates different production environment, there will be problems transplanted between different operating systems;

There are representatives language C, C ++, Go, Pascal, objective-C, swift, etc.

Interpreted language: No compile links, line by line explanation only when you run the program, line by line run.

Advantages: First, platform compatibility, and can run in any environment, of course, the premise is a virtual machine (interpreter) is installed, the second is flexible and modify the code directly modify when you can, you can quickly deploy, not down for maintenance; the disadvantage is the low efficiency of the implementation (note only the efficiency, the efficiency of the preparation of an interpreted language is very high)

On behalf of the language have Javascript, Python, Ruby, PHP, Perl, Erlang.

Added: Another type of hybrid languages, such as Java and C #

The difference between static and dynamic languages language
Dynamic Language: Runtime structure can change the language, such as new functions, object code can be introduced even existing function can be deleted or other structural changes. Popular point that the code can change its structure under certain conditions at run time.

There are: Object-C, C #, JavaScript, PHP, Python, Erlang.

Static language: In contrast to the dynamic language runtime can not change the structure of language

There are: Java, C, C ++

Here we must distinguish between a static language and statically typed languages, and dynamic languages ​​dynamically typed languages, dynamically typed language is the only language data type checking is done at runtime, that is the data type; dynamic language is one that can change the structure of operation, said structure.

Data types dynamically typed languages ​​is not determined at compile time, but delayed the type of binding to the operational phase, the main languages: Python, Ruby, Erlang, JavaScript, swift, PHP, Perl.

Static data type of language is determined (before or run) at compile time writing code to explicitly determine the data type of the variable. The main languages: C, C ++, C #, Java, Object-C.

The underlying data type
python there int, str, bool several data types

  1. int
    int integer, the range python2 an int: -2 31 to 2 31-1; in almost python3 may represent any integer

  2. STR
    STR is a string, the calculation method is +, *

  3. BOOL
    BOOL is a Boolean value that indicates true and false two states, True and False

Published an original article · won praise 1 · views 32

Guess you like

Origin blog.csdn.net/qq_43372180/article/details/104441883