Feb-20-2019, 12:43 PM
class SuperClass: def __init__(self,a1,a2): self.attribute1=a1 self.attribute2=a2 def getAttribute1(self): return self.attribute1 def setAttribute2(self,a1): self.attritube1=a1 def getAttribute2(self): return self.attribute2 def setAttribute1(self,a2): self.attribute2=a2 class SubClass (SuperClass): def __init__(self,a1,a2,a3): SuperClass.__init__(self,a1,a2) # better # super().__init__(self,a1,a2) self.attribute3 = a3 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","!!!") testObject.printMessage()you may want also to check the other thread - https://python-forum.io/Thread-Class-exa...-the-error
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs