Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Calculadora básica
- class calculadora(object):
- def soma(self, a, b):
- return a + b
- def sub(self, a, b):
- return a - b
- def div(self, a, b):
- return a / b
- def multi(self, a, b):
- return a * b
- #from nomedoarquivo import nome da classe
- from Calculadora import calculadora
- c = calculadora()
- print('Soma: ', c.soma(15,15))
- print('Subtração: ', c.sub(100,28))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement