All Python objects have three attributes: type, ID, and value. All are read-only with a possible exception of the value (which can be changed only if the object is mutable).
5.
str() vs. repr()
repr() is a built-in function while str() was a built-in function that changed to a factory function in Python 2.2. They will both return a string representation of an object; however, str() returns a printable string representation while repr() (and the backquote operator '') return an evaluatable string representation of an object, meaning that it is a string that represents a (valid) Python object that would be created if passed to eval().
6.
Object equality
type(a) == type(b)
whether the value of type(a) is the same as the value of type(b)... == is a value compare
type(a)istype(b)
whether the type objects returned by type(a) and type(b) are the same object
Since there exists only one (type) object for each built-in type, there is no need to check their values; hence, only the latter form should be used.