python中判断变量类型应该用isinstance() 而不要用type
如 n = 10 , 判断n是否为int, isinstance(n, int)
转载于:https://www.cnblogs.com/chimmu/p/6212318.html