Advertisement
BrunoTeles

Calculadora Pitão

Sep 25th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. class Calculadora:
  2.  
  3.     def __init__(self, a, b):
  4.         self.a = a
  5.         self.b = b
  6.  
  7.     def soma(self):
  8.         return self.a + self.b
  9.  
  10.     def multiplica(self):
  11.         return self.a * self.b
  12.  
  13.     def divide(self):
  14.         return self.a / self.b
  15.  
  16.     def reducao(self):
  17.         return self.a % self.b
  18.  
  19.  
  20. def tamanho(c):
  21.     c = bin(c)[2:]
  22.     print(c)
  23.     return len(c)
  24.  
  25.  
  26. a = Calculadora(128, 2)
  27. print(Calculadora)
  28. d = int(input("numero"))
  29. b = tamanho(d)
  30. print(b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement