Playing cards.
Card is a class that represents a single card in a deck of cards. For example:
MyCard(suit=2, rank=11)
c = MyCard(suit=1, rank=3)
assert str(c) == '3 of Diamonds'
c2 = MyCard(suit=2, rank=11)
assert str(c2) == 'Jack of Hearts'
You can do comparisons of cards, too!
assert c2 > c
You can show the docs for methods by calling show_doc. For example, the code show_doc(Card.eq) produces the following documentation:
Checks whether self and other have the same rank and suit.
card1 = MyCard(suit=1, rank=3)
card2 = MyCard(suit=1, rank=3)
assert card1 == card2