forked from KenzieAcademy/backend-katas-functions-loops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
41 lines (28 loc) · 777 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python
"""Implements math functions without using operators,
except for '+' and '-'.
"""
__author__ = "???"
def add(x, y):
"""Add two integers."""
# your code here
return
def multiply(x, y):
"""Multiply x with y using the add() function above."""
# your code here
return
def power(x, n):
"""Raise x to power n, where n >= 0, using the functions above."""
# your code here
return
def factorial(x):
"""Compute the factorial of x, where x > 0, using the functions above."""
# your code here
return
def fibonacci(n):
"""Compute the nth term of fibonacci sequence using the functions above."""
# your code here
return
if __name__ == '__main__':
# your code to call functions above
pass