Python basic knowledge of grammar

Introduction 1. programming language

  Low-level language: -------- internal computer machine language only accept binary code, it is represented by 1 or 0 instruction is referred to as machine instructions, machine instructions constituting entire machine language of the computer.

       -------- assembly language machine language with substantially the same, are operating directly on the hardware, but uses a command identifier abbreviation is easier to recognize and remember.

  Advantages: lowest level language, fast.

  Cons: too complex; the lowest development efficiency.

  High-level language: the atmosphere by two types of conversion mode

       ---------- refers compiled class before performing the source application, source code will be "translated" into object code (machine language).

         Advantages: does not require source code is executed when the program is not dependent language environment; fast execution.

         Disadvantages: need to be recompiled every time you modify the source code; cross-platform poor.

       ---------- explained based application source code while "translated" by the corresponding language interpreter as object code (machine language), i.e. translate and execute.

         Pros: good cross-platform; can be modified at any time.

         Disadvantages: low operating efficiency; plaintext code.

   Which, python is an interpreted language, want to run the code must be executed by an interpreter.

2. Variable

  Definition: the intermediate results of the program operation is temporarily stored into memory, the code continues to prepare for call back.

  Naming rules:

      Variable names can only be arbitrary letters, numbers, underscores combination

      Beginning of the first character can not be a number

      Keywords can not declare variables

  Which it noted that: generally considered all uppercase called constants.

 

 

 

Guess you like

Origin www.cnblogs.com/hyan0913/p/8519741.html