Skip to content
Snippets Groups Projects
Commit 9c05ac84 authored by Belfadel Mohamed's avatar Belfadel Mohamed
Browse files

str

parent 24c713fb
No related branches found
No related tags found
No related merge requests found
......@@ -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:
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment