Course Content
Week 1: Getting Started
In week 1 the basis goal is to get started with the basics.
0/2
Week 2: Variables & Data Types
Variables are containers that computer programs use to store information pertinent to what that computer program will do. Data Types are the different types of Variables and how Python uses these variables when building logic
0/2
Week 3: Making Decisions
In both computer programs and the AI world, computer programs need a way to make decisions. Booleans and Conditionals provide a way to make this happen.
0/2
learning Python Programming and also Intro to Games

Lesson 11: Drawing with Turtle

Topics Covered:

  • Installing and importing the turtle module
  • Creating a turtle window
  • Basic turtle movement commands: forward, left, right

What is Turtle Graphics?

turtle is a Python module that lets you draw by controlling a “turtle” that moves on the screen.

Installing Turtle

If you’re using standard Python, turtle is included by default. For online editors, check their documentation.

Basic Turtle Program

import turtle

t = turtle.Turtle()

t.forward(100)   # Move forward 100 pixels
t.left(90)       # Turn left 90 degrees
t.forward(100)

turtle.done()    # Keep window open

Basic Commands

  • forward(distance): Move turtle forward
  • backward(distance): Move turtle backward
  • left(angle): Turn turtle left
  • right(angle): Turn turtle right
  • penup() and pendown(): Lift or put down the pen

Activity: Draw a Square

import turtle

t = turtle.Turtle()

for _ in range(4):
    t.forward(100)
    t.left(90)

turtle.done()

Challenge

  • Change the square size
  • Try drawing a triangle or hexagon