判断是否是字符串
a = 1 b = "1" print(isinstance(a,str)) print(isinstance(b,str)) False True
判断是否是列表
a = [1,2,3,4] b = "1" print(isinstance(a,list)) print(isinstance(b,list))
判断是否是字符串
a = 1 b = "1" print(isinstance(a,str)) print(isinstance(b,str)) False True
判断是否是列表
a = [1,2,3,4] b = "1" print(isinstance(a,list)) print(isinstance(b,list))