This function can be applied to any value. It returns a type object corresponding to the type of that value.
For built-in types, the type object is the same as the name of
the type: int, str, list, and so on. To test whether a value is some type x, you can use the
predicate “Ttype(”.
x)
is T
If you display a type object in conversational mode, it will
look like “<type '”. Examples:
T'>
>>> type(i) <type 'int'> >>> type(i) is int True >>> type([2,4,8]) is list True