Skip to content
Closed
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 modified __pycache__/calculator.cpython-312.pyc
Binary file not shown.
Binary file not shown.
35 changes: 25 additions & 10 deletions calculator.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
def multiply(a,b):
def multiply(a, b):
return a * b

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

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

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

def square(a):
return a * a

print("I'm going use the calculator functions to multiply 5 and 6")
x = multiply(5,6)
print(x)
def cube(a):
return a ** 3

def square_n_times(number, n):
result = number
total = 0
for _ in range(n):
result = square(result)
total += result
return total


if __name__ == "__main__":
print("I'm going use the calculator functions to multiply 5 and 6")
x = multiply(5, 6)
print(x)