python类型校验type
1 >>> if type(l)==type([]): 2 print("y") 3 4 5 y 6 >>> type(l)==type([]) 7 True 8 >>> type(l)==list 9 True 10 >>> isinstance(l,list) 11 True 12 >>>
1 >>> if type(l)==type([]): 2 print("y") 3 4 5 y 6 >>> type(l)==type([]) 7 True 8 >>> type(l)==list 9 True 10 >>> isinstance(l,list) 11 True 12 >>>