Skip to content

Commit 142b96e

Browse files
author
Argenis Contreras
committed
added 2 functions
1 parent 16fd37f commit 142b96e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

calculator.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ def subtract(a, b):
1313
def divide(a, b):
1414
return a / b
1515

16+
def square(a):
17+
return a * a
18+
19+
def cube(a):
20+
return a * a * a
21+
22+
def square_n_times (number, n):
23+
for _ in range(n):
24+
number = number ** 2
25+
return number
26+
1627

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

0 commit comments

Comments
 (0)