diff --git a/TP9/card.py b/TP9/card.py index 87327796900d438f6d6b9b255604987d70f43a0d..820363743b107ae69723229107636f2804072c99 100755 --- a/TP9/card.py +++ b/TP9/card.py @@ -71,6 +71,16 @@ class Card(object): 'Card("Ace", "heart")' """ return f"Card(\"{self.value}\", \"{self.color}\")" + + def __str__(self) -> str: + """ + return a string representation of the card + + $$$ repr(Card('Ace', 'heart')) + 'Card("Ace", "heart")' + "Ace of heart" + """ + return f"{self.value} of {self.color}" def compare(self, card: Card) -> int: """ @@ -124,7 +134,7 @@ class Card(object): $$$ len(set(cartes)) len(cartes) """ - ... + def __eq__(self, card: Card) -> bool: """