Isinstance is an intrinsic function syntax in Python: Isinstance (object, ClassInfo) If the argument object is an instance of ClassInfo, or object is an instance of a subclass of the ClassInfo class, Returns True. If object is not a given type, the returned result is always false. If ClassInfo does not represent a class (type Object), then it is either a tuple of a class or recursively contains such a tuple of data types. Other sequence types are not allowed. If ClassInfo is not a data type or a tuple of data types, a TypeError exception is thrown.Example:>>> isinstance (1, int) determines whether the int type true>>> isinstance (1.0, float) determines whether it is float type true>>> s = ' abc ' & Gt;>>isinstance (s,basestring" to determine if the string type True>>>isinstance (a,dict) Determines whether object A is a dictionary, if true, prints true, such as false, to print false.
Python isinstance function to determine whether the element is a string, int, float type