Skip to content

Python Basics I: Turtle Graphics

Course overview

This course teaches the most fundamental concepts of programming through visual turtle graphics. When students write code, they can immediately see the result on screen, so they can understand abstract concepts concretely. The concepts learned at this stage become the common foundation for every programming language.

Estimated time: 16-32 hours

The time required depends on the student's grade level, prior experience, and learning speed, and varies greatly. It also differs between just learning the basic concepts and moving on, versus additional practice problems or creative projects: taking those on makes a difference too. The times above are an average range, so please proceed flexibly at your child's pace.

What abilities will it build?

Complex shapes are the problem-solving ability to break them into small steps: that gets trained. The process of finding repeating patterns and turning them into rules becomes the foundation for the ability to discover meaningful patterns in data. The most important skill in the AI era, "the ability to look at data and find the rules," is experienced visually.

What principles will you learn?

  • (Data storage - variables) Variables are the most basic way to store data. You'll learn how to store and reuse values (data) such as colors, sizes, and angles. This is the starting point of all data processing.
  • (Data patterns - loops) By expressing repeating patterns in code, you'll learn the principle of efficiently generating and processing regular data. This is the basic principle of big-data processing.
AI-era thinking: computing (problem-solving) | data-driven | probabilistic thinking

Computational Thinking

Skill Description Example activity
๐Ÿงฉ Decomposition Breaking a complex problem into small steps Breaking the Hangul 'ใ„ฑ' into "forward โ†’ turn right โ†’ forward"
๐Ÿ”„ Pattern recognition Finding repeating rules Square = repeating "forward+turn" 4 times
๐Ÿ’ก Abstraction Removing unnecessary details and extracting only the essentials Storing a color in a variable to reuse it
๐Ÿ“ Algorithm Designing a step-by-step procedure for solving a problem Drawing a star: repeat 5 times (forward โ†’ turn 144 degrees)

Mathematical connections

Math concept Programming application Learning benefit
Angles and geometry right(90), left(120) Understanding that the sum of a polygon's exterior angles = 360ยฐ
Sequences range(1, 10, 2) โ†’ 1, 3, 5, 7, 9 The concept of the first term and common difference in an arithmetic sequence
Variables and substitution x = 100, forward(x) The concept of variables in algebra
Rules and formulas forward(i * 10) The linear function y = ax relationship

Problem-solving process

flowchart LR
    A[1. Understand<br/>Analyze the problem] --> B[2. Plan<br/>Design the algorithm]
    B --> C[3. Execute<br/>Write the code]
    C --> D[4. Review<br/>Debug]
    D -.->|Error found| B
๐Ÿ’ป Code examples & visualization

Example 1: Drawing a square - the power of loops

Without a loop (inefficient)

from turtle import *

forward(100)
right(90)
forward(100)
right(90)
forward(100)
right(90)
forward(100)
right(90)

Using a loop (efficient)

from turtle import *

for i in range(4):      # Repeat 4 times
    forward(100)        # Forward 100
    right(90)           # Right 90 degrees

Result:

    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚             โ”‚
    โ”‚             โ”‚ 100 pixels
    โ”‚             โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        100 pixels


Example 2: Drawing a star - the math of angles

from turtle import *

for i in range(5):       # Repeat 5 times
    forward(100)         # Forward 100
    right(144)           # Right 144 degrees (360รท5ร—2=144)

Why 144 degrees? (the math behind it)

A star's points = 5
One full turn = 360ยฐ
A star turns twice = 720ยฐ
Turn at each point = 720ยฐ รท 5 = 144ยฐ

Result:

       โ˜…
      /\
     /  \
    /    \
   /โ”€โ”€โ”€โ”€โ”€โ”€\


Example 3: Spiral pattern - using the variable i

from turtle import *

for i in range(50):
    forward(i * 5)    # The bigger i gets, the longer
    right(91)         # 91 degrees, not 90!

How it changes with the value of i:

i=0: forward(0)   โ†’ doesn't move
i=1: forward(5)   โ†’ 5 pixels
i=2: forward(10)  โ†’ 10 pixels
i=3: forward(15)  โ†’ 15 pixels
...
i=49: forward(245) โ†’ 245 pixels

Result (spiral):

          โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
       โ•ญโ”€โ”€โ•ฏ    โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ    โ”‚
    โ•ญโ”€โ”€โ•ฏ    โ•ญโ”€โ”€โ•ฏ      โ”‚    โ”‚
    โ”‚    โ•ญโ”€โ”€โ•ฏ   โ—     โ”‚    โ”‚
    โ”‚    โ”‚            โ•ฐโ”€โ”€โ”€โ”€โ•ฏ
    โ•ฐโ”€โ”€โ”€โ”€โ•ฏ


Example 4: Conditionals - changing colors

from turtle import *

colors = ["red", "blue", "green", "yellow"]

for i in range(4):
    pencolor(colors[i])   # Pick the i-th color
    forward(100)
    right(90)

Flowchart:

flowchart TD
    A[Start] --> B{i = 0, 1, 2, 3}
    B --> C[Change color<br/>pencolor]
    C --> D[forward 100<br/>right 90]
    D --> E{i < 4?}
    E -->|Yes| B
    E -->|No| F[End]


Example 5: Defining a function - reusable code

from turtle import *

def draw_square(size):
    """A function that takes a size and draws a square"""
    for i in range(4):
        forward(size)
        right(90)

# Call the function - squares of various sizes
draw_square(50)    # Small square
draw_square(100)   # Medium square
draw_square(150)   # Large square

Result (concentric squares):

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚   โ”‚
โ”‚ โ”‚ โ”‚         โ”‚   โ”‚   โ”‚
โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚   โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜


1. Become a turtle tamer

A. import - importing a library

Item Content
What will you learn? Bringing in and using code that someone else made
Core Concepts Modularization, code reuse, libraries

importis Opening a ready-made toolbox is like this. Python provides thousands of libraries, and the turtle library is one of them. Students learn that you don't need to build everything from scratch. This introduces a core principle of modern software development, code reuse.


C-H. Moving and turning (shape, forward, turn, Hangul consonants)

Item Content
What will you learn? Moving the turtle to draw shapes
Core Concepts Coordinate geometry, sequential execution, algorithms

forward()and right()/left() function to move the turtle move precise distances and angles. As students draw the Korean consonants (ใ„ฑ, ใ„ด, ใ„ท), they learn how to break a complex shape into simple steps. This is the heart of algorithmic thinking - "breaking a big problem into small steps." Through angle calculations, geometric thinking develops naturally as well.


2. An artist's tools

A. Declaring variables (Variables)

Item Content
What will you learn? Naming and storing data
Core Concepts Memory, data storage, abstraction

A variable is putting a name tag on a box that holds dataIt is. color = "red" stores the value "red" under the name color. Students learn that a computer can store data in memory and retrieve it later. This concept is one of the most fundamental and important concepts in programming.


B-D. Setting colors and reusing variables

Item Content
What will you learn? Setting background and pen colors, and using variables
Core Concepts Changing properties, code efficiency, the DRY principle

bgcolor()and pencolor() functions to control visual elements. Storing a color in a variable lets you reuse the same value in many places. If you want to change the color, you only edit one place - this is the DRY (Don't Repeat Yourself) principleIt is.


3. Number wizard

Understanding the range() function

Item Content
What will you learn? Generating number sequences
Core Concepts Sequences, loop ranges, parameters

range() A function generates an ordered sequence of numbersdoes this. range(5) makes 0, 1, 2, 3, 4, and range(1, 6) makes 1, 2, 3, 4, 5. Using a third argument (step), you can range(0, 10, 2) make patterns like 0, 2, 4, 6, 8. Students learn how to express mathematical sequence concepts in code.


4. The turtle at a crossroads

Conditionals (If, Else, Elif)

Item Content
What will you learn? Running different code based on conditions
Core Concepts Branching, decision-making, controlling program flow

Conditionals are the core structure that lets a program "think and decide." if checks an "if ~" condition, and else handles "otherwise." elif (else if) is used to check several cases in order. Once they understand this structure, students pick up a systematic way of thinking that classifies problems into cases.


5. The tireless turtle

For loop basics and applications

Item Content
What will you learn? Repeating a fixed number of times
Core Concepts Repetition, automation, indentation

for A loop is the command "do this N times." for i in range(4): repeats the code below it 4 times. Students learn that indentation determines which code repeats. They can efficiently draw patterns like a square (forward 4 times, turn 90 degrees) or a star (forward 5 times, turn 144 degrees) - draw patterns efficiently . Loops tap into one of a computer's most powerful abilities, helping students understand the power of automation.


6. Dazzling kaleidoscope patterns

Using the loop variable i

Item Content
What will you learn? Using a value that changes each loop
Core Concepts Loop variables, dynamic calculation, pattern generation

Loop variable iis which iteration you're on . Using this value in a calculation lets you produce a different result each loop. For example, forward(i * 10) draws lines that get longer and longer: 10, 20, 30, ... Students learn how to express patterns that change regularly mathematically. This concept is used to create many visual patterns such as spirals, concentric circles, and bar graphs.


7. Make your own functions

Defining and calling functions

Item Content
What will you learn? Making reusable blocks of code
Core Concepts Abstraction, modularity, parameters

A function a named bundle of code that performs a specific taskIt is. def draw_square(): defines a function that draws a square, and draw_square() calls it. Students learn that they don't have to write the same code over and over . Using parameters, they can draw draw_square(100), draw_square(50)like squares of different sizes. Functions are the most important abstraction tool in programmingIt is.


8. Make your own universe

Spiral pattern project

Item Content
What will you learn? Creating complex patterns with a loop variable
Core Concepts Algorithm design, mathematical patterns, experimentation

The spiral is a classic project that uses a loop variable. Changing the angle from 90 to 91 degrees produces a completely different pattern. Students see, visually, how a small change makes a big difference in the result. This encourages an experimental mindset of "what happens if I change ~?" As students create their own patterns, they exercise creativity and logical thinking at the same time .


When you finish this course...

Learning outcomes

Students will be able to:

  • Turtle Graphics to draw a variety of shapes and patterns
  • Apply algorithmic thinking that breaks a problem into small steps
  • Understand the core concepts of variables, conditionals, loops, and functions
  • Experience making abstract concepts concrete through visual output
  • Take an attitude of debugging without fear of errors
  • Build a solid foundation for moving on to more complex projects