Why not introduce beginners to Python using the Turtle Library? Python is a text-based programming language. To prepare elementary and middle school students to master this language, a good starting point is the Turtle Library. The Turtle Library is a collection of commands that can be used to create artwork and games.
What Is Python?
Python is a programming language created by Guido van Rossum about thirty years ago. His goal was to invent code that was easy to read, write, and understand. Today, Python is used by programmers to develop programs that:
- analyze large amounts of data
- build models to test ideas
- find information on a website
- host websites
- design and launch mobile apps
- support machine learning, which is when a device can improve how it works by itself
Python’s use by programmers is one of the reasons why teachers should introduce beginners to Python using the Turtle Library. It is important to hook student interest in programming in a fun way. The skills and knowledge they learn will provide a solid foundation for future learning.
What Is the Turtle Library?
The Python programming language uses special words to tell the computer what to do. A function is a word that does a specific task. Many Python functions are stored into libraries.
The Turtle Library is a set of commands that control a robotic Turtle making it move, draw, and write. When programming with Python, students must import the Turtle Library using the line of code: from turtle import *. This will then allow them to use all the commands from the Turtle Graphics Standard Library.
5 Reasons to Introduce Beginners to Python Using the Turtle Library
1. Create Fun-Looking Programs that Excite Young Programmers
Python is a text-based programming language. The program output can be viewed in a Python Shell. However, the Python Shell only shows words. There are no graphics or animation. Instead, it is just plain text. This is not exciting to young programmers.
The Turtle Library of commands uses a canvas to show the program’s output. This invites creativity! Students can program a robotic Turtle to move around the screen to solve a maze. Programmers can create colorful artwork. Or, they can invent games for players. The possibilities are endless! The appeal to using the Turtle Library is that the program’s output looks fantastic – which is a great way to hook young programmers.
2. Spark Creativity and Ignite an Interest in Programming
Kids are naturally drawn to making things. Whether it is painting, coloring, or writing they want to express their ideas and share their creations with others. Python programming combined with the Turtle Library invites artistic expression.
Students can design programs that draw pictures from lines, shapes, and symbols. In addition, by looping a set of instructions they can produce colorful spirographs or surprising geometric patterns. The ability to make things encourages students to enjoy programming.
3. Code Make Sense
The first introduction to text-based programming should be fun. Typing line after line of code that looks like gibberish is not gratifying. Instead, you want students to feel empowered. The good news is that the Turtle Library of commands make sense.
The Turtle command names hint at what they do. For example, pensize(5) sets the thickness of the pen line; pencolor(“blue”) makes the outline color of the pen blue; and circle(20) draws a small circle.
The commands sequenced together make a simple program that draw a circle:
#draw a circle
from turtle import *
Imagine the possibilities! Since the Turtle Library of commands are understandable it makes programs easier to write and debug. Moreover, the simplicity provides a solid foundation for programming original creations. For example, students can extend their knowledge of drawing a circle to make a picture of a snowman, ant, or another object from circles.
4. Only a Few Lines of Code Do A Lot!
Young programmers tend to have limited typing skills. This makes writing line after line of code tiresome – and boring. Moreover, it can cause a programming task to take exceedingly longer than the time allocated for instruction.
The great news is that by combining Python with the Turtle library, students can write fun programs in only a few lines. For example, they can have the computer respond to a player by displaying a personalized message in just 3 lines! The simple code will show a text box that has the player type in their name. A message will then display that says “Hello Player Name“.
from turtle import *
name=textinput(“Name”, “What is your name?”)
write(“Hello ” +str(name))
5. Illustrate Programming Concepts in a Meaningful Way
Programming concepts such as loops or variables can be so abstract that they are difficult for beginners to understand. However, blending Python with the Turtle Library makes them tangible. This is because the output on the canvas allows students to see what is happening.
For example, you can tell a student that a loop is a set of instructions that repeat. However, if they build a simple program that draws and counts circles on the Turtle canvas then suddenly
for shape in range(4): makes sense. They can watch four circles being drawn, forming a direct connection to how the code makes loops work.
from turtle import *
for shape in range(4):
Introduce Beginners to Python Using the Turtle Library and TechnoTurtle
If you are looking for teaching ideas designed for elementary and middle school students check out TechnoTurtle. This project, published by TechnoKids Inc., has over 30 programming activities. Young programmers blend Python and the Turtle Library of commands to solve mazes, create artwork, and invent games.