Guest User

Untitled

a guest
Jun 18th, 2018
464
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #@author Rafael Salomao <rafaelgavazzi at gmail.com>
  2. #@author Natalia Marcondes < natalia.marcondes at gmail.com>
  3. #@author Marco Moura <email at marcomoura.com>
  4. #@author Luciana Mendes <super.luci at gmail.com>
  5. #@author Carlos Eduardo <kaddxxi at gmail.com>
  6. #@author Patricia Carvalho <patfcarv at gmail.com>
  7.  
  8. __date__ ="$13/10/2010 08:02:27$"
  9.  
  10. class ReversedNum:
  11.  
  12. def revert(self, num):
  13. valor = ""
  14. while(num > 0):
  15. resto = num%10
  16. num = num/10
  17. valor = str(valor)+str(resto)
  18. return int(valor)
  19.  
  20. def somar(self, num1, num2):
  21. valor = num1+num2
  22. return valor
  23.  
  24. def revertersoma(self,num1,num2):
  25. return self.revert(self.somar(self.revert(num1),self.revert(num2)))
  26.  
  27. def separar(self,num):
  28. valor = num.split(" ")
  29. result = self.revertersoma(int(valor[0]),int(valor[1]))
  30. return result
  31.  
  32.  
  33. revert = classmethod(revert)
  34. somar = classmethod(somar)
  35. revertersoma = classmethod(revertersoma)
  36. separar = classmethod(separar)
  37.  
  38.  
  39. #if __name__ == "__main__":
  40. # print "Hello World"
Add Comment
Please, Sign In to add comment