fork download
  1. class number :
  2. def _init_(self, value):
  3. self.value=value
  4.  
  5. def _add_(self, other):
  6. return self.value+other.value
  7. n1=Number (10)
  8. n2= Number (20)
  9. result= n1+n2
  10. print("sum= ",result)
  11.  
Success #stdin #stdout 0.02s 7068KB
stdin
Standard input is empty
stdout
Standard output is empty