Skip to content
Snippets Groups Projects
Commit 495e84a8 authored by Ayoub Buhyari's avatar Ayoub Buhyari
Browse files

fin classe

parent 6396b448
No related branches found
No related tags found
No related merge requests found
......@@ -157,33 +157,21 @@ class Card(object):
return True if self don't equal card
False otherwise
"""
return (self.value != card.value) and (self.color != card.color)
return (self.value != card.value) or (self.color != card.color)
def __lt__(self, card: Card) -> bool:
"""
return True if self is strictly inferior to card
False otherwise
"""
if self.value < card.value:
res= True
elif self.value==card.value:
if self.color< card.color:
res = True
else:
res = False
else:
res = False
return res
return self.compare(card)<0
def __le__(self, card: Card) -> bool:
"""
return True if self is inferior or equal to card
False otherwise
"""
if self.value <= card.value:
return True
else:
return False
return self.compare(card)<=0
def __gt__(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