发布者: 笨鸟自学网
type函数返回一个对象的类型。举个例子:
type
print(type('')) # Output: <type 'str'> print(type([])) # Output: <type 'list'> print(type({})) # Output: <type 'dict'> print(type(dict)) # Output: <type 'type'> print(type(3)) # Output: <type 'int'>
id()函数返回任意不同种类对象的唯一ID,举个例子:
id()
name = "Yasoob" print(id(name)) # Output: 139972439030304
Archiver|手机版|笨鸟自学网 ( 粤ICP备20019910号 )
GMT+8, 2024-11-21 19:24 , Processed in 0.112044 second(s), 17 queries .
© 2001-2020