Answers for "python calling method from constructor"

0

python calling method from constructor

class TheBestClass:
  def __init__(self, num1, num2)
    self.number1 = num1
    self.number2 = num2
    self.AddTogether()   #call it within self.
    
  def AddTogether(self):
    print(self.number1 + self.number2)
Posted by: Guest on September-15-2020

Code answers related to "python calling method from constructor"

Python Answers by Framework

Browse Popular Code Answers by Language