Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Commit 74d51fc

Browse files
author
Holger Lösken
committed
Added task 7
1 parent 9879d6a commit 74d51fc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,26 @@ and return the last `6` non-zero numbers.
102102
- `F8` = `21`, return `21`
103103
- `F38` = `39088169`, return `88169`
104104

105+
### Task 7
106+
107+
Given the follwing function you should suggest what could be improved. There are no other documents explaining why this function has been written or what the purpose is/should be.
108+
109+
```python
110+
def multiply(x, y):
111+
if y > 0:
112+
return (1 + multiply(x, y-1))
113+
else:
114+
return 0
115+
```
116+
117+
**Possible considerations:**
118+
119+
- Does the function really _multiply_ two values?
120+
- Could the in-built multiply function be used?
121+
- Is a recursive function the way to go?
122+
- What can happen when using this with big numbers, f. ex. > 1.000.000?
123+
- Type hints
124+
105125
## Contribute
106126

107127
Feel free to contribute. Use the issue list to propose new tasks or open PRs. Just provide proper tests

0 commit comments

Comments
 (0)