# 判断对象是否可调用,可调用,即对象后加() s = "abc" ls = [1,2,3] def f(): pass class F(): pass t =(s, ls, f, F) for obj in t: if callable(obj): print(obj, True) else: print(obj, False)
# 判断对象是否可调用,可调用,即对象后加() s = "abc" ls = [1,2,3] def f(): pass class F(): pass t =(s, ls, f, F) for obj in t: if callable(obj): print(obj, True) else: print(obj, False)