Drawing a Shape

0

Drawing a Shape

  • You know the movements of the turtle, you can move on to making actual shapes. You can start by drawing polygons since they all consist of straight lines connected at certain angles. 
Here’s an example that you can try:

Source Code:

#Follow - Programmerfect

import turtle as t
t.fd(100)
t.rt(90)
t.fd(100)
t.rt(90)
t.fd(100)
t.rt(90)
t.fd(100)

Output:

Note : the turtle can be programmed to create different shapes and images.
 
Now, try drawing a rectangle, using this code as a template. Remember, in a rectangle, all four sides are not equal. You’ll need to change the code accordingly. Once you do that, you can even try creating other polygons by increasing the number of sides and changing the angles.
 
 
 

 

Post a Comment

0Comments
Post a Comment (0)