题解 | #坐标移动#
坐标移动
http://www.nowcoder.com/practice/119bcca3befb405fbe58abe9c532eb29
def func(loc):
if loc[0] == 'A':
start[0] -= int(loc[1:])
if loc[0] == 'D':
start[0] += int(loc[1:])
if loc[0] == 'W':
start[1] += int(loc[1:])
if loc[0] == 'S':
start[1] -= int(loc[1:])
start = [0,0]
for i in input().split(';'):
if i and len(i)>1:
if i[0] in 'WSAD':
if i[1:].isdigit() and len(i[1:])<=2:
func(i)
print(f'{start[0]},{start[1]}')

