Python Python restart the foundation

Development language

  High-level language: Python, JAVA, PHP, C #, GO, ruby, C ++ (generated byte code)

  Low-level language: C, Assembler (machine code generation)

  The contrast between the language

    PHP classes: for writing web pages, limitations

    Python, Java: either write web pages, you can also write back-office functions (both compared to the former low efficiency, high development efficiency; the latter high efficiency, low development efficiency)

Python species

  JPython

  IronPython

  CPython

  JavaScriptPython

  RubyPython

  This is the Python pypy CPython development (when the development is completed, the machine code is automatically formed again executed, saved for later use machine code directly) performed faster than CPython

  ……

Python basis

  Beginning Python file inside Linux system must have the following code - ↓ (second line if it is not Python3 above plus)

#!/usr/bin/env python

# -*- coding:utf8 -*-

  Python is a Python interpreter software (memory management)

  Python's .py suffix.

  Single-line comments beginning with # multi-line comment with the end of each three single or double quotes.

  Basic data type (string, integer)

    String: the beginning and end quotes is called a string. Such as '', '', '' '' '' "" "" "" (only four combinations). There are addition and multiplication function.

    Integer: that is digital. * Represents multiplication and ** represents the power,% denotes a remainder, // represents division floor (i.e. the maximum integer not greater than)

  Variable by the variable name and value components.

  Variable names can only consist of letters, numbers, underscores, but can not begin with a number, a variable name is not a keyword, it is best not to keep the built-in Python stuff (built-in method or the built-in class) repeat.

  关键字有:and、as、assert、break、class、continue、def、del、elif、else、except、exec、finally、for、from、global、if、import、in、is、lambda、not、or、pass、print、raise、return、try、while、with、yield。

  Represented by indenting Python code block, code block in the same layer, but also the same indentation

  Conditional statements (if)

'' ' 
IF
Condition: block elif Condition : block
...
the else:
  block
' ''

  Loop [while (infinite loop),]

'' ' 
The while Condition:     
    block 

' ''

 

  input a = input ( 'Enter') acquires data input by the user, and assigned to a string of the form

  print print ( 'hello world') printout 'hello world'

  It refers to the generation of air pass code meaningless, but is used to represent a code block.

  and logical AND (&) to take a same

  or logical OR (|) has a take a

  not logical not (!) Conversely

  

  

Guess you like

Origin www.cnblogs.com/Yncd1999/p/11295527.html