We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14ef13b commit 34998a0Copy full SHA for 34998a0
Status/Day 5.md
@@ -195,7 +195,25 @@ while True:
195
lst = list(int(i[2:]) if i[0] == 'D' else -int(i[2:]) for i in lines)
196
print(sum(lst))
197
```
198
+---
199
+```python
200
+'''Solution by: popomaticbubble
201
+'''
202
+transactions = []
203
204
+while True:
205
+ text = input("> ")
206
+ if text:
207
+ text = text.strip('D ')
208
+ text = text.replace('W ', '-')
209
+ transactions.append(text)
210
+ else:
211
+ break
212
+
213
+transactions = (int(i) for i in transactions)
214
+balance = sum(transactions)
215
+print(f"Balance is {balance}")
216
+```
217
---
218
219
[**_go to previous day_**](https://github.com/darkprinx/100-plus-Python-programming-exercises-extended/blob/master/Status/Day%204.md "Day 4")
0 commit comments