Skip to content

Commit 49c6ab7

Browse files
authored
Update Day 4.md
1 parent f716ba7 commit 49c6ab7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Status/Day 4.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,16 @@ x = input('please enter a digit:')
169169
reduce(lambda x, y: int(x) + int(y), [x*i for i in range(1,5)])
170170
```
171171
---
172+
```python
173+
'''Solution by: lcastrooliveira
174+
'''
175+
def question_15(string_digit):
176+
return sum(int(string_digit * n) for n in range(1, 5))
177+
178+
inp = input()
179+
print(question_15(inp))
180+
```
181+
---
172182

173183
[**_go to previous day_**](https://github.com/darkprinx/100-plus-Python-programming-exercises-extended/blob/master/Status/Day%203.md "Day 3")
174184

0 commit comments

Comments
 (0)