This morning to learn isinstance, a little understanding, on the record (do not know right)
Syntax: Isinstance (Object,type)
function: to determine whether an object is a known type.
Its first argument (object) is the second parameter (type) is the type name (int ...). Or a list of type names ((int,list,float) is a list ). Its return value is Boolean (True or flase).
Returns true if the type of the object is the same as the type of parameter two. If parameter two is a tuple, returns true if the object type is the same as one of the type names in the tuple.
Here are two examples:
Example One
>>> A = 4
>>> isinstance (A,int)
True
>>> isinstance (A,STR)
False
>>> Isinstance (A, (str,int,list))
True
Example Two
>>> a = "B"
>>> isinstance (A,STR)
True
>>> isinstance (A,int)
False
>>> Isinstance (A, (int,list,float))
False
>>> Isinstance (A, (INT,LIST,FLOAT,STR))
True
The use of the isinstance of the built-in function in Python