Python Turtle Graphics Tutorial for Beginners

Python Knowledge Sharing #2

Geno Tech
3 min readOct 27, 2021
Photo by Emile Perron on Unsplash

Turtles concept comes for graphics in programming at the beginners level. If you are a beginner in python, you also need to learn turtles and their basics. In my knowledge-sharing journey, Here I discussed python turtles and some basic examples of using them. You can see the full documentation here.

Turtle graphics is a popular way for introducing programming to kids. It was part of the original Logo programming language developed by Wally Feurzeig, Seymour Papert and Cynthia Solomon in 1967.

Turtles are used for the simulation of real-world scenarios in programming. A robot path is a famous example that you can simulate on a 2D plane.

Let’s think the robot start at (0,0) and go forward by 20 units. first, we have to initialize a turtle and move forward by 20 units as follows.

import turtle 
turtle.forward(20)

Then the robot needs to turn left by 60 degrees and go forward by 20 units.

turtle.left(60)
turtle.forward(20)

Likewise, robots can follow any path on a 2d plane. Also, we can simulate complex paths using loops and other techniques in python. In below, I show you five examples that every programmer implement commonly for learning purpose.

--

--

Geno Tech

Software Development | Data Science | AI — We write rich & meaningful content on development, technology, digital transformation & life lessons.