1. Python All objects
The whole of the methods that contain a series of data and manipulate the data is called an object
2. Composition of data types
Composed of three parts
Identity ID View unique identifier, memory address by this Oh!
Type types can take a look at
Value data item
The proud conclusion in a book is that everything in Python is a pointer, so there's no need to think about pointers.
3. Common basic data types
int integral type
Boolean Boolean type
String character type
List lists
Tuple tuples
Dict Dictionary
4. Data type is not variable
Immutable Type: int Boolean string tuple
Variable type: List Dict
The following ID (b) has not changed
>>> B = [1, "a", 234]
>>> ID (b)
40771336
>>> b[2]= "Asdfa"
>>> b
[1, ' A ', ' ASDFA ']
>>> ID (b)
40771336
5. Assigning values to variables everything is quoted, dynamic and dynamic types why not in the dynamic
Dynamic, defined after the type is OK, do not need to declare beforehand. However, after the definition cannot be converted dynamically
>>> a = "1234"
>>> a+1
Traceback (most recent):
File "<stdin>", line 1, in <module>
Typeerror:cannot concatenate ' str ' and ' int ' objects
>>> Int (a) +1
1235
>>>
6. Type conversion int Boolean
Print 1==1 True
A = bool (1==1)
Lesson Three: Python basic data Type lectures (1/3)