Answers for "calling __init__ function python"

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

Python Answers by Framework

Browse Popular Code Answers by Language