Python判断变量的数据类型的两种方法Python中的数据类型有数字、字符串,列表、元组、字典、集合等。有两种方法判断一个变量的数据类型1、isinstance(变量名,类型)a = isinstance(a, int)2、通过与其他已知类型的常量进行对比a = type(a) == type(1)