About python, entry

A. Computer Basics

1.1 Computer Organization

  • Input and output devices
  • cpu central processing unit, the equivalent of the human brain
  • Memory for storing data
  • Hard disk storage data

1.2 What is the operating system

  • Control computer work flow software
  • Software installed on top of the operating system is the application

1.3 summary

  • cpu human brain
  • Memory person's temporary memory
  • Hard disk memory of people forever

About two .python

2.1python main application areas

  • Cloud computing: cloud computing the hottest language, typical applications OpenStack
  • WEB development: Youtube, Dropbox, watercress
  • Artificial Intelligence: A typical library NumPy, pandas
  • System operation and maintenance: operation and maintenance personnel must-language
  • reptile
  • Finance: quantitative trading, financial analysis.

The difference 2.2python2 and python3

  • python2 source is not uniform, there is duplication of code
  • python3 source unified, and there is no duplication of code

2.3 programming language

2.3.1 compiled and interpreted

ps: is an interpreted language with an interpreter, compiled language using a compiler

  • Compiled is the source of each statement are compiled into machine language, and save the file to binary, machine language the computer can directly execute this program so running.

    Compiled languages: C / C ++, Golang

    Advantages: run fast

    Cons: Slow development efficiency

  • Explanatory at the time of program execution, and was interpreted as a one language to perform, so the speed is very slow

    This is because the code is not executed by the computer (who wrote the statement), but generated by the code machine language (binary form)

    Interpreted languages: java, C #, php, javascript, python, ruby, etc.

    Advantages: running slow

    Cons: fast development efficiency

Kind 2.4python interpreter

The role of interpreter : convert binary code in the form of machine language, allowing the machine to perform (cmd python is entered into the python interpreter)

  • CPython

    python in C language. CPython will source (py files) into bytecode file (the pyc files), then run on a virtual machine python

  • Jython

    the python java implementation, Jython java code dynamically compiled into bytecode, then run on jvm

  • Ironpython

    C # implementation python, the python IronPython C # code is compiled into byte code, and then executed on the CLR

  • PyPy

    The python code is compiled directly into machine code.

III. Getting Started

3.1 Variable Rules

  • Variables are letters, numbers, underscores

  • Prohibit begin with a number

  • Prohibit the use of python keywords

  • You can not use Chinese and Pinyin

  • Variable names are case-sensitive

  • Variable names must be descriptive

  • Recommended wording

    CamelCase, underscore naming

3.2 Constant (constant amount)

  • Variable name in uppercase

3.3 Notes

  • Single-line comments #
  • Multi-line comments "" "" "" or '' '' ''

3.4 Data Types

  • Integer numbers
  • String of characters
  • Boolean value right or wrong
  • List
  • Tuple
  • dictionary
  • set

Guess you like

Origin www.cnblogs.com/gaoyukun/p/11116201.html