Python完美走位
def getResult(s):# 统计 W, A, S, D 四个方向的步数step_count = {"W": 0,"A": 0,"S": 0,"D": 0}for c in s:step_count[c] += 1avg = len(s) / 4 #
def getResult(s):# 统计 W, A, S, D 四个方向的步数step_count = {"W": 0,"A": 0,"S": 0,"D": 0}for c in s:step_count[c] += 1avg = len(s) / 4 #