[프로그래머스] 수 조작하기 1 파이썬
def solution(n, control): for i in range(len(control)): if control[i] == "w": n = n + 1 elif control[i] == "s": n = n - 1 elif control[i] == "d": n = n + 10 else: n = n - 10 return n def solution(n, control): key = dict(zip(['w','s','d','a'], [1,-1,10,-10])) return n + sum([key[c] for c in control]) def solution(n, control): answer = n c = { 'w':1, 's':-1, 'd':10, 'a':-10} for i in control: answ..