Skip to content

Commit 0ed7bb3

Browse files
authored
Merge pull request #2 from code4policy/calc2
Calc2
2 parents cb07eeb + 2cf3e23 commit 0ed7bb3

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

calculator.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ def subtract(a,b):
1010
def divide(a,b):
1111
return a/b
1212

13+
def square(a):
14+
return a*a
15+
16+
def cube(a):
17+
return a*a*a
18+
19+
def square_n_times(number, n):
20+
total = 0
21+
for _ in range(n):
22+
number = square(number)
23+
total += number
24+
return total
25+
1326
print("I'm going use the calculator functions to multiply 10 and 2")
1427
c=multiply(10,2)
1528
print(c)

0 commit comments

Comments
 (0)