《流畅的Python》读书笔记----第一章 Python数据模型
[toc]
第一章 Python数据模型一摞Python风格的纸牌123456789101112import collectionsCard = collections.namedtuple('Card',['rank','suit'])class FrenchDeck: ranks = [str(n) for n in range(2,11)] + list("JQKA") suits = 'spades diamonds clubs hearts'.split() def __init__(self): self.__cards = [Card(rank,s
...