Skip to content

Commit cb030b6

Browse files
author
Kamrul Ahsan
authored
Update 100+ Python challenging programming exercises.txt
1 parent efe7850 commit cb030b6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

100+ Python challenging programming exercises.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,21 @@ while True:
465465
else:
466466
pass
467467
print (netAmount)
468+
469+
My solution:
470+
x = 0
471+
y = 0
472+
while True:
473+
inp = input()
474+
if inp == '':
475+
break
476+
if inp.split()[0] == 'D':
477+
x += int(inp.split()[1])
478+
if inp.split()[0] == 'W':
479+
y += int(inp.split()[1])
480+
print(x-y)
481+
482+
468483
#----------------------------------------#
469484

470485
#----------------------------------------#

0 commit comments

Comments
 (0)