def __str__(self): # Please find it within yourselves to forgive me for the following self.sortCards() # Split the cards into a list of 5 elements (one for each line of the card). # Each element will contain a tuple consisting of # X elements, where X is the # of cards in the hand zipped = zip(*[card.templatedParts() for card in self.cards]) # Now, we convert each element of 'zipped' into a string, and join them # by newlines result = "\n".join("".join(map(str, l)) for l in zipped) return result
def __str__(self): zipped = zip(*[card.templatedParts() for card in self.played_cards.values()]) result = "\n".join("".join(map(str, l)) for l in zipped) return result
def __str__(self): zipped = zip( *[card.templatedParts() for card in self.played_cards.values()]) result = "\n".join("".join(map(str, l)) for l in zipped) return result