Answers for "python ajouter enlever d'un compte"

0

python ajouter enlever d'un compte

total = 0
while True:
    s = input().split()
    if not s:            # break if the string is empty
        break
    # two inputs are distributed in cm and num in string data type
    cm, num = map(str, s)

    if cm == 'D':
        total += int(num)
    if cm == 'W':
        total -= int(num)

print(total)
Posted by: Guest on May-02-2020

Python Answers by Framework

Browse Popular Code Answers by Language