Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list是可变列表, 里面可以存不同的数据类型, 支持列表推导式, 但是并不高效.
- array.array适合存储大量的数据, 因为在背后存储的并不是float对象, 而是字节表述.
- set适合大量contains检测.
- deque适合频繁先进先出的场景, 还支持rotate等复杂操作
- tuple可以具名.
- heapq提供了heappush和heappop方法, 让用户可以把可变序列当做堆队列或者优先队列来使用.
- ================
- 可以对list实行切片操作.
Add Comment
Please, Sign In to add comment