python ajouter enlever d 27un compte

Solutions on MaxInterview for python ajouter enlever d 27un compte by the best coders in the world

showing results for - "python ajouter enlever d 27un compte"
Sean
08 Jan 2017
1total = 0
2while True:
3    s = input().split()
4    if not s:            # break if the string is empty
5        break
6    # two inputs are distributed in cm and num in string data type
7    cm, num = map(str, s)
8
9    if cm == 'D':
10        total += int(num)
11    if cm == 'W':
12        total -= int(num)
13
14print(total)