1. Identity, type, value. Where identity is the identity of each object, is closely related to the memory address, the available ID () is returned, and the type determines what type of value the object can hold, using the type () function, the isinstance () function to get the object's type, and the value is the data represented by the object.
2. Cannot change the value after the object creation is not updated. In Python, lists, dictionaries can be changed, numbers, strings, tuples are immutable
3. Type
strings, lists, and tuples are accessed sequentially, that is, attributes that have slices.
A mapping Type (dictionary) is a sequence-like index, but its index is not sliced in sequential numbers, but is accessed through a unique key or keyword, which holds a collection of hash-value pairs.
4.type () returns the type of the given parameter. The return is actually a type object that outputs a string
5. In many cases, they return the same. The difference is that the object returned by STR () is user-friendly and more suitable for print. Repr () Returns an object that is system friendly, returns an "official" display of a string, and in most cases can be re-acquired with Eval ().
Repr () is basically equivalent to the anti-quote "'
6. Type (a) = = Type (b)
Call two times the type () function and compare the two
Type (a) is type (b)
Comparing objects with object identities is worth comparing and improving the efficiency of Python
7. Slightly
8. The same points are arrays, which are container types, are read sequentially, accessed, and have slicing operations.
The difference is that the value of the list can be updated, mutable, tuples are not updatable, immutable
9.
is btrue is dtrue is Ffalse
Python caches a range of simple integers, and Python does not create new objects when assigning values to C and D, so comparing the identities of a, B objects, or C, D objects is the same as the result.
In Python 2.7, the cache range is (-5,256)
Python core Programming-fourth chapter-Exercise