# breaking it down medium

Turtle in the Garden

The garden turtle wanders the grid: N, S, E, W, one square at a time, starting at (0, 0). 🐢

You get the moves. Print x <final x> y <final y> on line one (E adds to x, N adds to y). On line two print came home yes if it ever RETURNED to (0,0) after leaving, else came home no.

Example:

Input: moves = "NESW" Output:

x 0 y 0
came home yes

N, E, S, W trace out a full square back to (0, 0). Since it returns after leaving, it counts as came home yes.

šŸ’” need a hint?

brk-turtle-garden.pyšŸ”’ given lines are locked — write your code in between
loading...