Mars Rover Problem in Python