Dear Friends
I am new in Python Programming and i try to exercise myself with some small programs. I try to study classes so i made the above small program.
I have some mistakes but i cant find them
I am new in Python Programming and i try to exercise myself with some small programs. I try to study classes so i made the above small program.
class SuperClass: def _init_(self,a1,a2): self.attribute1=a1 self.attribute2=a2 def getAttribute1(self): return self.attritube1 def setAttribute2(self,a1): self.attritube1=a1 def getAttribute2(self): return self.attribute2 def setAttribute1(self,a2): self.attribute2=a2 class SubClass (SuperClass): def getAttribute3(self): return self.attribute3 def setAttribute3(self,a3): self.attribute3=a3 def printMessage(self): print("My attributes are:", self.getAttribute1() ,self.getAttribute2(), self.getAttribute3()) testObject=SubClass("Hello","World","!!!") textObject.printMessage()So my result has to print > My attributes are: Hello world!!
I have some mistakes but i cant find them