type函数返回一个对象的类型。举个例子:
type
print(type('')) # Output: print(type([])) # Output: print(type({})) # Output: print(type(dict)) # Output: print(type(3)) # Output:
id()函数返回任意不同种类对象的唯一ID,举个例子:
id()
name = "Yasoob" print(id(name)) # Output: 139972439030304