Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added __pycache__/calculator.cpython-314.pyc
Binary file not shown.
Binary file not shown.
21 changes: 18 additions & 3 deletions calculator.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
def multiply(a,b):
return a * b

def add(a,b):
return a+b

def subtract(a,b):
return a-b

def multiply(a,b):
return a * b

def divide(a,b):
return a/b

def square(a):
return a*a

def cube(a):
return a*a*a

def square_n_times(number, n):
if n < 0:
raise ValueError("n must be non-negative number")
total = 0
value = number
for _ in range(n):
value = value * value
total += value
return total

print("I'm going use the calculator functions to multiply 5 and 6")
x = multiply(5,6)
Expand Down