Playing Card

class Card[source]

Card(suit=0, rank=2)

Represents a standard playing card.

Attributes: suit: integer 0-3 rank: integer 1-13

Card is a class that represents a single card in a deck of cards. For example:

Card(suit=1, rank=3)
3 of Diamonds
c = Card(suit=1, rank=3)
assert str(c) == '3 of Diamonds'

c2 = Card(suit=2, rank=11)
assert str(c2) == 'Jack of Hearts'

Card.__lt__[source]

Card.__lt__(other)

Compares this card to other, first by suit, then rank.

returns: boolean

You can do comparisons of cards, too!

assert c2 > c