Skip to content

Commit ba5abfc

Browse files
authored
Update Day 5.md
1 parent 6d44972 commit ba5abfc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Status/Day 5.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,22 @@ balance = sum(transactions)
215215
print(f"Balance is {balance}")
216216
```
217217
---
218+
```python
219+
'''Solution by: ChichiLovesDonkeys
220+
'''
221+
222+
money = 0
223+
while 1:
224+
trans = input().split(' ')
225+
if trans[0] == 'D':
226+
money = money + int(trans[1])
227+
elif trans[0] == 'W':
228+
money = money - int(trans[1])
229+
elif input() == '':
230+
break
231+
print(f'Your current balance is: {money}')
232+
```
233+
---
218234

219235
[**_go to previous day_**](https://github.com/darkprinx/100-plus-Python-programming-exercises-extended/blob/master/Status/Day%204.md "Day 4")
220236

0 commit comments

Comments
 (0)