import sys def func(cmd,x,y): try: if cmd[0] not in ('A','D','W','S'): return x,y if not cmd[1:].isdigit(): return x,y steps = int(cmd[1:]) if steps < 1 or steps > 99: return x,y if cmd[0] == 'A': ...