Level 2 Xinshoucun Meng new --Python based learning

Today, learning content classification programming language, installation and set environment variables Python interpreter, two operating methods and variables Python program file execution step Python, the concept of constant, what they learn is still relatively simple.

First, the classification of programming languages

  1.1, machine language 

    Binary programming instructions, hardware essentially direct operation 

    Advantages: high efficiency

    Disadvantages: the development of low efficiency, high learning curve

  1.2, assembly language

    Instead of two labels made of instructions in English, but also the nature of the hardware directly

    Advantages: high efficiency

    Disadvantages: the development of low efficiency, high learning curve

  1.3, high-level language

    Must be translated into machine language the computer to perform

    1.3.1, compiled

      Compiled once, to get the results can be performed repeatedly without recompilation

      Advantages: high efficiency

      Disadvantages: trouble debugger, cross-platform poor

    1.3.2, interpreted

      Translate and execute

      Advantages: development of high efficiency, high cross-platform, easy debugging

      Disadvantages: low efficiency

Two, Python interpreter environment variable installation and

Three ways both run Python programs

  3.1, Interactive

 

  3.2, the command line

Step four executed, Python file

  The Python interpreter code read from the hard disk into memory

  Py file will be read from the hard disk into memory

  Py interpreter read the contents of the file, interpreted into machine language

Fifth, the concept of variables and constants

  5.1 Variable

    5.1.1, the variable three elements:

      Variable name: represents the memory address space, comparison is.

      Data Type: decision-access modes exist in memory

      Value: Data stored in the memory, the comparative ==

    5.1.2, a small integer pool

      In order to optimize the operation speed, Python is a number between [-5,256] open a separate memory,

      When referring to them as data variables point to the same memory address.

    5.1.3 garbage collection

      Reference count: references to the objects the counter is 0, automatically reclaims the memory

      Clear mark: problem solving circular references

      Generational Recovery: Depending on the median survival time is divided into different levels, the lower, the higher the level garbage collection sweep frequency

  5.2 Constant

    python in no way specifically defined constants, usually expressed in uppercase variable names.

 

    

  

Guess you like

Origin www.cnblogs.com/binyuanxiang/p/11104719.html