fork download
  1. class op():
  2. def __init__(self,num1,num2):
  3. self.x = num1
  4. self.y = num2
  5.  
  6. def soma(self):
  7. return self.x + self.y
  8.  
  9. def somadez(self):
  10. return self.soma() + 10
  11.  
  12. conta1 = op(1, 2)
  13. print(conta1.soma())
  14. print(conta1.somadez())
  15.  
  16. #https://pt.stackoverflow.com/q/442138/101
Success #stdin #stdout 0.02s 9224KB
stdin
Standard input is empty
stdout
3
13