# Card Example # A Card object is a standard poker playing card. class Card: def __init__(self, the_rank, the_suit): self.rank = the_rank self.suit = the_suit def color(self): if self.suit == "C" or self.suit == "S": return "black" else: return "red" # Represent card as a string. # The symbols list entries "0" and "1" are dummy entries. def __str__(self): symbols = ["0", "1", "2", "3", "4", "5", "6", "7", \ "8", "9", "10", "J", "Q", "K", "A"] return symbols[self.rank] + self.suit