PYTHON isinstance语法
def obj_len(arg): #isinstance(),判断是否是某一类 if isinstance(arg,str) or (isinstance(arg,list)) or (isinstance(arg,tuple)): if len(arg) > 5: return True else: return False return None temp = [123] ret = obj_len(temp) print(ret)
def obj_len(arg): #isinstance(),判断是否是某一类 if isinstance(arg,str) or (isinstance(arg,list)) or (isinstance(arg,tuple)): if len(arg) > 5: return True else: return False return None temp = [123] ret = obj_len(temp) print(ret)