First, the data structure
program = data structure + algorithm
Data:
A collection of data elements that are organized in a way, such as numbering elements , that can be numbers or characters, or even other data structures.
The most basic data structure of Python is the sequence
Each element in the sequence is assigned an ordinal (that is, the position of the element) and also the index: index numbering starts at 0
Python contains 6 built-in data series: List, Ganso, String, Unicode string, Buff object, and Xrange object
Ii. key elements of Python
Basic data types
Object reference
Combining data types
logical operators
Control flow Statements
Arithmetic operators
Input/Output
Creation and invocation of functions
1. Basic data types in Python
Any programming language must be able to represent basic data items
The basic data types in Python are:
Integral type:
Integral type: Immutable type
-257.20162
Boolean type:
True,false
Floating-point types:
Floating point number:
3.141592
Plural:
3+6j
Decimal digits:
String
' GNU is not Unix ', ' Hello '
2. Object reference (variable)
Python saves all data as a Memory object
In Python, a variable actually refers to a reference to a Memory object
Dynamic type:
At any point in time, an object reference can re-reference a different object (with different data types) whenever necessary.
The built -in function type () is used to return the data type of a given data item
"=" is used to bind a variable name to an object in memory: If the object exists beforehand, it is bound directly; otherwise, the referenced object is created by "="
n [1]: a= ' mageedu ' in [2]: Type (a) out[2]: Strin [3]: a=3.14in [4]: Type (a) out[4]: Floatin [5]:
This article is from the "Xiexiaojun" blog, make sure to keep this source http://xiexiaojun.blog.51cto.com/2305291/1845688
Python two, Python process-oriented programming Quick Start