while stack.isEmpty() != 1:
fin = stack.pop()
print fin - output is (1,1)
k = final.get(fin)
return k
def directionToVector(direction, speed = 1.0):
dx, dy = Actions._directions[direction]
return (dx * speed, dy * speed)
directionToVector = staticmethod(directionToVector)
but when I do this return, it gives me an error and final is the directory that I have made with lists of keys and values
The error is:
File "line 212, in directionToVector
dx, dy = Actions._directions[direction]
KeyError: 'W'