A primer
1 What is data?
x=10,10 is the data we want to store.
2 Why data is divided into different types
Data is used to represent States, and different States should be represented by different types of data.
3 Data types
Numbers (shaping, long-shaped, floating-point, plural)
String
BYTE string: Describes the byte bytes type when introducing character encoding
List
Meta-group
Dictionary
Collection
4 Expand Data Type learning by following several points
#一: Basic use 1 Purpose 2 definition way 3 common operation + built-in method # Two: The type Summary 1 to save a value or save multiple values can be stored in a value of multiple values, the value can be what type 2 ordered or unordered 3 variable or immutable !!! Variable: The value changes, the ID does not change. Variable = not hash !!! Immutable: The value changes, and the ID is changed. immutable = = can be hashed
Two numbers
Integral type and floating point type
#整型int role: Age, grade, social Security number, QQ number and other integer-related definitions: age=10 #本质age =int (Ten) #浮点型float role: salary, height, weight, physical parameters and other floating point salary=3000.3 #本质salar Y=float (3000.3)
Res=float ('3.1')print(Res,type (res))
#二进制, Decimal, octal, hex
Other number types (understanding)
#长整形 (understanding) in Python2 (no long shaping concept in Python3): >>> num=2l >>> type (num) <type ' Long ' > #复数 (Learn)
x=1-2jPrint(x.real)print(X.IMAG)
Python Learning experience second week-01