The correct and simple code for "Around 1-apple" is
while not wall_in_front(): move() if object_here(): take() if wall_in_front(): turn_left() if at_goal(): done()