can anyone find the mistake in line 6 or explain for me what's wrong | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

can anyone find the mistake in line 6 or explain for me what's wrong

class domino : def __init__(self,A0,B0): self.A=A0 self.B=B0 def affiche_pts(self): self.print('face A:', self.A) self.print('face B:', self.B) def valeur(self): return(self.print(self.A+self.B)) d1=domino(2,6) d2=domino(4,3) d1.affiche_pts() d2.affiche_pts() print('total des pts :',d1.valeur()+d2.valeur())

20th Oct 2016, 6:14 PM
Mohamed Amine Aouainia
1 Answer
+ 3
Your class has no print() method, so remove the self. from self.print() everywhere in your code.
20th Oct 2016, 6:21 PM
Zen
Zen - avatar