Page 16 - 2501_KVS_C-6
P. 16

1.3 UNDERSTANDING SCREEN AND TURTLE(PEN)
                      Gowri: In the file that we just opened to draw a shape using Turtle, we need to write a few
                      commands to prepare our canvas and pen for drawing.

                  The CODING AREA is the place where we write the instructions for drawing shapes.
                  The SCREEN  AREA is the place where we actually see the shape (output) that we draw using
                  instructions.
                  The Turtle ➤ that we see in the middle of screen area (canvas) is actually the PEN. By moving this
                  pen in different directions, we can draw rectangles, triangles, squares, circles, stars, and more.

                      Aryan: It seems very interesting. Please show me how to draw these using this pen shaped
                  turtle.. now I am also loving this idea of yours. It is really SUPER COOL!

                      Gowri:  To begin this, you need to write the following lines:

                  import turtle        →  to start the working of turtle
                  scr=turtle.Screen()  →  to prepare the screen or canvas for drawing

                  pen=turtle.Turtle()  →  to get the pen ready for drawing





























                                        Fig. 1.2: Coding screen and output screen (Canvas with turtle)

                  1.4 INTRODUCTION TO PROGRAMMING WITH TURTLE

                      Gowri: If I ask you to draw a line in your notebook, what would you do?

                      Aryan: Hey  ..It is not funny I know..I will take a blank sheet of paper
                      and a pen, then make a line in any direction- it's as simple as that.
                      Gowri: Exactly! It's just as simple with Turtle. Look, I will show you;
                      Think of the CANVAS/SCREEN as your paper, and the turtle pen as
                      your on-screen pen. The commands you give will make the line appear on
                      the screen.




                14                         KVS DELHI REGION 2025
   11   12   13   14   15   16   17   18   19   20   21