netAmount = 0
while True:
s = raw_input()
if not s:
break
values = s.split(" ")
operation = values[0]
amount = int(values[1])
if operation=="D":
netAmount += amount
elif operation=="W":
netAmount -= amount
else:
pass
print netAmount
报了什么错?
本地的python是什么版本?
看着的python2的代码,看你输入是什么