diff --git a/Status/Day 5.md b/Status/Day 5.md index 540695d..65fd1ef 100644 --- a/Status/Day 5.md +++ b/Status/Day 5.md @@ -240,6 +240,22 @@ while 1: break print(f'Your current balance is: {money}') ``` +--- +''' +'''TJ''' +import re +amount = 0 +while True: + ipt = input() + if re.match('D', ipt): + amount += int(ipt[2::]) + if re.match('W', ipt): + amount -= int(ipt[2::]) + if ipt == '': + break +print(amount) +''' + --- [**_go to previous day_**](https://github.com/darkprinx/100-plus-Python-programming-exercises-extended/blob/master/Status/Day%204.md "Day 4")