command pattern the turtle is simple line-and-fill tool that helps to visualize what the robot is doing in the preceding codewe import the turtle library nextwe set the line color to blue and the background color to red thenwe tell the turtle to record the current point as the start of polygon that will be filled later thenthe loop draws the four sides of the square finallythe end_fill(method fills the polygon with red the done(method keeps the program from terminating and closing the window once the process is completed if you are using an ubuntu system and get an error message regarding python -tkyou need to install the package sudo apt-get install python -tk run the codeand you should see little triangle (the turtlemove on the screen this approach works while we are trying to draw shapes and lines on the screenbut since the turtle is just metaphor for our robotdrawing pretty shapes does not have lot of use we are going to extend our robot control script to accept four commands (startstopturn left degreesand turn right degrees)which we will map to keyboard keys turtle_control py import turtle turtle setup( screen turtle screen(screen title("keyboard drawing!" turtle turtle(distance def advance() forward(distancedef turn_left() left( def turn_right() right(