fork download
  1. class Calc:
  2. def __init__(self, a, b):
  3. self.a = a
  4. self.b = b
  5. def plus(self):
  6. return self.a + self.b
  7. def minus(self):
  8. return self.a - self.b
  9.  
  10. print(Calc(3, 2).plus())
  11.  
  12. print(Calc(3, 2).minus())
Success #stdin #stdout 0.02s 9068KB
stdin
Standard input is empty
stdout
5
1