My Neighbor Totoro is simple to learn Python

Basics of office politics.

  1. cpu quite the brain responsible for computation and problem solving fastest
  2. Temporary memory to store data fast charge
  3. Data storage hard charge cloud long slow
  4. The operating system provides a bridge to the computer all independent infrastructure so that they can establish links with each other

python applications and history

python2 Version: source code is not uniform, repeat function `difficult maintenance

python3 Version: Code to reduce the difficulty of maintaining unity

What is a python programming language

Category: compiled, interpreted.

Compiled; translated only once

Advantages: run fast

Disadvantages: slow development

Representatives: c, c ++

Interpreted: Progressive Translation

Pros: Fast Development

Cons: Slow speed

Representatives Language: python

Mixed: java

python advantages and disadvantages

  1. easy to understand
  2. Development of high efficiency
  3. High-level language
  4. portability

python species

python simple to install and configure the environment

  1. Free set at the beginning of exe

Write a python program

  1. ptini ()

variable

A simple variable names instead of variable `

  1. Decline line consisting only of alphanumeric
  2. You can not begin with a number
  3. You can not use the keyword
  4. It is not intended to build and use Chinese pinyin
  5. Case sensitive
  6. Variable names to be meaningful
  7. Recommended wording:
    1. Hump ​​body: capitalize the first letter
    2. Decline line: official recommendation _

Steady

  1. Variable names in all caps as a constant

Note

  1. Some do not understand the code for a functional description Remarks - makes it easier to understand
  2. When the line (one-way) Note: # comment line only, can not wrap
  3. Multi-line comments: Support Wrap
  4. Notes content in the program does not run
  5. But will not use the annotation content into a string

The basis of the type of acquaintance

  1. int numbers - Plastic

  2. str string is quoted

User input input

  1. input (), in parentheses prompt
  2. python3 version obtained content are strings
  3. type View type

Flow control statements if five options

Simply choose

if conditions:

One of many

if conditions:

Result

elif condition:

Result

elif condition:

Result

Multiple choice is not limited to:

if conditions:

Result

if conditions:

Result

if conditions:

Result

Guess you like

Origin www.cnblogs.com/mjf-2321277702-19941129/p/10968557.html