Python中的常见内置类型

# 1. None (全局只有一个)
    a = None
    b = None
    print(id(a) == id(b))  # True
# 2. 数值
    int
    float
    complex(复数)
    bool
# 3. 迭代类型
# 4. 序列类型
    list
    bytes、bytearray、memoryview(二进制序列)
    range
    tuple
    str
    array
# 5. 映射(dict)
# 6. 集合
    set
    frozenset
# 7. 上下文管理类型
# 8. 其他
    模块类型
    class和实例
    函数类型
    方法类型
    代码类型
    object对象
    type类型
    ellipsis类型
    notimplemented类型

猜你喜欢

转载自www.cnblogs.com/believepd/p/10777234.html