Skip to content

Commit

Permalink
Added calculator to root
Browse files Browse the repository at this point in the history
  • Loading branch information
Umair Khan committed Mar 26, 2024
1 parent c5c7838 commit f291228
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions calculator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class Calculator:
def add(x, y):
return x + y

def subtract(x, y):
return x - y

def multiply(x, y):
return x * y

def divide(x, y):
if y == 0:
return 'Cannot divide by 0'
return x * 1.0 / y

0 comments on commit f291228

Please sign in to comment.