We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d19ea5 commit cd0105eCopy full SHA for cd0105e
1 file changed
calculator.py
@@ -10,6 +10,20 @@ def subtract(a,b):
10
def divide(a,b):
11
return a/b
12
13
+def square(a):
14
+ return a * a
15
+
16
+def cube(a):
17
+ return a ** 3
18
19
+def square_n_times(a, n):
20
+ result = a
21
+ total = 0
22
+ for _ in range(n):
23
+ result = square(result)
24
+ total += result
25
+ return total
26
27
print("I'm going use the calculator functions to multiply 5 and 6")
28
x = multiply(5,6)
29
print(x)
0 commit comments