Drawing with Python turtle?
Tags: python
Published: 2020-05-12 15:24:38

Turtle designs is a mainstream path for acquainting <a href="https://python.org">Python</a> programming with kids. It was a piece of the first Logo programming language created by Wally Feurzeig, Seymour Papert and Cynthia Solomon in 1967. 

Envision a mechanical turtle beginning at (0, 0) in the x-y plane. After an import turtle:

* provide it the order turtle.forward(15)
* proceeds onward (screen!) 15 pixels toward the path it is confronting, drawing a line as it moves. 
* Provide it the order turtle.right(25), and it pivots set up 25 degrees clockwise.

The program below demonstrates the use of Python turtle:

```python
import turtle                                                                                                        
                                                                                                                     
turtle.shape("turtle")                                                                                               
turtle.speed(10)                                                                                                     
turtle.pendown()                                                                                                     
turtle.begin_fill                                                                                                    
turtle.color('green')                                                                                                
turtle.circle (100)                                                                                                  
turtle.pencolor('red')                                                                                               
turtle.fillcolor('blue')                                                                                             
turtle.end_fill                                                                                                      
turtle.pendown()                                                                                                     
turtle.circle(100)                                                                                                   
turtle.goto(0,200)                                                                                                   
turtle.right(90)                                                                                                     
turtle.forward (100)                                                                                                 
turtle.right (45)                                                                                                    
turtle.forward(100)                                                                                                  
turtle.left (180)                                                                                                    
turtle.forward(200)                                                                                                  
turtle.left(180)                                                                                                     
turtle.forward(100)                                                                                                  
turtle.right (45)                                                                                                    
turtle.forward(100)                                                                                                  
turtle.backward(200)                                                                                                 
turtle.forward(100)                                                                                                  
turtle.right(45)                                                                                                     
turtle.forward(100)                                                                                                  
turtle.backward(200)                                                                                                 
turtle.forward(100)                                                                                                  
turtle.right(45)                                                                                                     
turtle.left(25)                                                                                                      
turtle.hideturtle() 
```

The program above draws:

![turtle python](https://dev-to-uploads.s3.amazonaws.com/i/bzwqslr820ny5s716gbd.png)

**Related links:**
* <a href="https://pythonbasics.org">Learn Python</a>
* <a href="https://pypi.org/project/PythonTurtle/">Python turtle app</a>