Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Domino :
- # Constructeur
- def __init__(self, A=0, B=0):
- self.A = A
- self.B = B
- # Méthode
- def affiche_points(self):
- print ("Premiere face A : {}\nDeuxieme face B : {}".format(self.A,self.B))
- def valeur(self):
- somme = self.A + self.B
- return somme
- d1 = Domino(2,6)
- d2 = Domino(3,2)
- d3 = Domino(4,3)
- d1.affiche_points()
- d2.affiche_points()
- print "Somme total des points :", d1.valeur() + d2.valeur()
- liste_de_7_dominos = []
- for i in range(7):
- liste_de_7_dominos.append(Domino(6, i))
- print liste_de_7_dominos
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement