Skip to content
Open
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
42 changes: 41 additions & 1 deletion calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,47 @@ def subtract(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):
total = 0
for _ in range(n):
number = square(number)
total += number
return total

print("I'm going use the calculator functions to multiply 10 and 2")
c=multiply(10,2)
print(c)

print("I'm going use the calculator functions to add 10 and 2")
d = add(10,2)
print(d)

print("I'm going use the calculator functions to subtract 10 and 2")
e = subtract(10,2)
print(e)

print("I'm going use the calculator functions to divide 10 and 2")
f = divide(10,2)
print(f)

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

print("I'm going use the calculator functions to add 5 and 6")
y = add(5,6)
print(y)

print("I'm going use the calculator functions to subtract 5 and 6")
a = subtract(5,6)
print(a)

print("I'm going use the calculator functions to divide 5 and 6")
b = divide(5,6)
print(b)