Playing Cards
A Deck of cards is a collection of Card
objects:
deck = Deck()
assert isinstance(deck.pop_card(), Card)
If we remove a card from the Deck we can verify that it no longer exists:
card23 = Card(2, 3)
deck.remove_card(card23)
assert card23 not in deck.cards
However, another card that we haven't removed, such as the 10 of hearts
will still be in the Deck of cards because we haven't removed it:
c = Card(2,10)
assert c in deck.cards
c