From 21b00bfdf35ff57d0f4fc1b14f06120cf3edb257 Mon Sep 17 00:00:00 2001 From: Nadir-1992 <130636035+Nadir-1992@users.noreply.github.com> Date: Sat, 30 Sep 2023 10:17:44 +0530 Subject: [PATCH] Update Day 5.md --- Status/Day 5.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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")