Skip to content

Commit 2c70e1e

Browse files
authored
Update Day 5.md
1 parent cf18762 commit 2c70e1e

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

Status/Day 5.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ while True:
101101
print(total)
102102
```
103103
-----------------
104-
**Solution by: leonedott**
104+
105105
```python
106+
'''Solution by: leonedott'''
107+
106108
lst = []
107109
while True:
108110
x = input()
@@ -118,6 +120,25 @@ for item in lst:
118120
balance -= int(item.strip('W '))
119121
print(balance)
120122
```
123+
------------------------
124+
```python
125+
'''Solution by: AlexanderSro'''
126+
127+
account = 0
128+
while True:
129+
action = input("Deposit/Whitdrow/Balance/Quit? D/W/B/Q: ").lower()
130+
if action == "d":
131+
deposit = input("How much would you like to deposit? ")
132+
account = account + int(deposit)
133+
elif action == "w":
134+
withdrow = input("How much would you like to withdrow? ")
135+
account = account - int(withdrow)
136+
elif action == "b":
137+
print(account)
138+
else:
139+
quit()
140+
```
141+
-----------------
121142

122143
[***go to previous day***](https://github.com/darkprinx/100-plus-Python-programming-exercises-extended/blob/master/Status/Day%204.md "Day 4")
123144

0 commit comments

Comments
 (0)