I code that to create a card game.
class JeuDeCarte:
def __init__(self):
self.contenu = []
self.j1 = []
self.j2 = []
self.CreerJeu()
def CreerJeu(self):
for color in couleur:
for number in numero:
self.contenu.append(Carte(number,color))
def melanger(self):
return shuffle(self.contenu)
def TailleJeu(self):
return(len(self.contenu))
def PaquetVide(self) :
return self.contenu ==[] #Renvoie True si il est vide, False sinon
def AfficherPaquet(self):
return self.contenu
jeu = JeuDeCarte()
jeu.melanger()
jeu.distribuer()
print(jeu.AfficherPaquet())
But when I run this code, I have this:
[<__main__.Carte object at 0x7f206d47c820>, <__main__.Carte object at 0x7f206d48d7c0>, <__main__.Carte object at 0x7f206d48da90>, <__main__.Carte object at 0x7f206d48d1c0>, <__main__.Carte object at 0x7f206d48d610>, <__main__.Carte object at 0x7f206d48d340>, <__main__.Carte object at 0x7f206d48d670>, <__main__.Carte object at 0x7f206d47c8e0>, <__main__.Carte object at 0x7f206d47ca00>, <__main__.Carte object at 0x7f206d47c9a0>, <__main__.Carte object at 0x7f206d47cee0>, <__main__.Carte object at 0x7f206d47ce20>, <__main__.Carte object at 0x7f206d48d4f0>, <__main__.Carte object at 0x7f206d48d220>, <__main__.Carte object at 0x7f206d47cac0>, <__main__.Carte object at 0x7f206d48d2e0>, <__main__.Carte object at 0x7f206d47cca0>, <__main__.Carte object at 0x7f206d48d5b0>, <__main__.Carte object at 0x7f206d48d130>, <__main__.Carte object at 0x7f206d48d550>, <__main__.Carte object at 0x7f206d47ce80>, <__main__.Carte object at 0x7f206d48d940>, <__main__.Carte object at 0x7f206d48d9a0>, <__main__.Carte object at 0x7f206d47c730>, <__main__.Carte object at 0x7f206d48d880>, <__main__.Carte object at 0x7f206d48d040>, <__main__.Carte object at 0x7f206d47cfa0>, <__main__.Carte object at 0x7f206d47c940>, <__main__.Carte object at 0x7f206d47cb80>, <__main__.Carte object at 0x7f206d47c790>, <__main__.Carte object at 0x7f206d48d8e0>, <__main__.Carte object at 0x7f206d48d6d0>, <__main__.Carte object at 0x7f206d48d460>, <__main__.Carte object at 0x7f206d48d280>, <__main__.Carte object at 0x7f206d48da00>, <__main__.Carte object at 0x7f206d47cd00>, <__main__.Carte object at 0x7f206d47cb20>, <__main__.Carte object at 0x7f206d47cf40>, <__main__.Carte object at 0x7f206d48d0a0>, <__main__.Carte object at 0x7f206d48d3a0>, <__main__.Carte object at 0x7f206d48d760>, <__main__.Carte object at 0x7f206d47c880>, <__main__.Carte object at 0x7f206d48d700>, <__main__.Carte object at 0x7f206d47cdc0>, <__main__.Carte object at 0x7f206d48d400>, <__main__.Carte object at 0x7f206d48d820>, <__main__.Carte object at 0x7f206d48daf0>, <__main__.Carte object at 0x7f206d48d490>, <__main__.Carte object at 0x7f206d47cd60>, <__main__.Carte object at 0x7f206d47ca60>, <__main__.Carte object at 0x7f206d47cbe0>, <__main__.Carte object at 0x7f206d47cc40>]
How to correct that?