class Card:
    """A card object with a suit and rank."""

    # Notice that these are class attributes, not instance attributes.
    RANKS = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
    SUITS = ('Spades', 'Diamonds', 'Hearts', 'Clubs')

    def __init__(self, rank, suit):
        """Create a Card object with the given rank and suit."""
        if (not rank in Card.RANKS or not suit in Card.SUITS ):
            print ("Not a legal card specification.")
            return
        self._rank = rank
        self._suit = suit

    def getRank(self):
        """Return my rank."""
        return self._rank

    def getSuit(self):
        """Return my suit."""
        return self._suit

    def __str__2(self):
        """Return a string that is the print representation
        of this Card's value."""
        r = self._rank
        # Note that we have to treat Ace, Jack, Queen, and 
        # King differently than the other cards for printing
        # purposes.
        if ( r == 1 ):
            myrank = "Ace"
        elif ( r == 11 ):
            myrank = "Jack"
        elif ( r == 12 ):
            myrank = "Queen"
        elif ( r == 13 ):
            myrank = "King"
        else:
            myrank = str( r )
        return myrank + ' of ' + self._suit

    def __str__(self):
        """Return a string that is the print representation
        of this Card's value."""
        trans = { 1:'Ace', 11:'Jack', 12:'Queen', 13:'King' }
        r = self._rank
        if r in [1, 11, 12, 13]:
            myrank = trans[r]
        else:
            myrank = str( r )
        return myrank + ' of ' + self._suit

    def __lt__(self, other):
        """Adding this function allows comparing Cards using
        conventional syntax. e.g., c1 < c2."""
        return ( self._rank < other.getRank() )

    def __eq__(self, other):
        return ( self._rank == other.getRank() )

    def __le__(self, other):
        return ( self._rank <= other.getRank() )
