题解 | #句子逆序#python
坐标移动
http://www.nowcoder.com/practice/119bcca3befb405fbe58abe9c532eb29
python 解法简单易懂
n = list(input().split(";"))
n.pop()
v = [0,0]
for i in n :
if i[0:1].isalpha() == True:
if i[1:].isdigit() == True :
if i[0] == "A":
nn = i[1:]
nn = int(nn)
v[0] = int(v[0]) - nn
if i[0] == "D":
nn = int(i[1:])
v[0] = int(v[0]) + nn
if i[0] == "W":
nn = int(i[1:])
v[1] = int(v[1]) + nn
if i[0] == "S":
nn = int(i[1:])
v[1] = int(v[1]) - nn
else:
continue
else:
continue
print(",".join(str(i) for i in v))