Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Calculator:
- def add(self, a, b):
- return a + b
- def subtract(self, a, b):
- return a - b
- def multiply(self, a, b):
- return a * b
- def divide(self, a, b):
- try:
- return a / b
- except ZeroDivisionError:
- return "You can't divide by zero!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement