python 判断一个变量是不是字符串 isinstance(s,str) 示例: s = 'asc' n = 12 print(isinstance(s,str)) # True print(isinstance(n,str)) # False