Let’s set up our Python adventure! Create a folder called PythonAdventures. Inside, we’ll save all our Python files (e.g., turtle_drawing.py). Use a text editor like Thonny or an online tool like Replit, and ensure Python is installed (Turtle is built-in). Ready? Let’s draw and code!
- Topic: Let’s draw shapes with Turtle and store values!
- Teaching Moment:
"Hello, class! Python is our magic coding tool, and Turtle is our drawing friend! Today, we’ll use variables—special boxes to store things like colors or sizes. Let’s draw together!" - Interactive Demo (turtle_start.py):
"I’m drawing a rectangle. Which sides are longer—the top and bottom, or left and right? Raise your hands!"- Kids: "Top and bottom!"
- Teacher: "Great! Let’s call the longer sides
long_sideand the shorter onesshort_side. What numbers should we use? How about 100 for top/bottom and 50 for left/right?" - Kids: "Yes!"
- Teacher: "Awesome! Where should we start drawing—left, top, right, bottom?"
- Kids: "Top left!"
- Teacher: "Perfect! Let’s set the starting point. What color should it be?"
- Kids: "Blue!"
- Sample Code (turtle_start.py):
import turtle t = turtle.Turtle() t.shape("turtle") long_side = 100 # Top and bottom length short_side = 50 # Left and right length color = "blue" # Our color choice t.color(color) t.penup() t.goto(-long_side/2, short_side/2) # Start at top left t.pendown() t.forward(long_side) # Top t.right(90) t.forward(short_side) # Right t.right(90) t.forward(long_side) # Bottom t.right(90) t.forward(short_side) # Left t.right(90) turtle.done()
- Explanation:
"long_sideandshort_sideare variables storing numbers.colorholds a word (string).goto()moves Turtle without drawing, andpendown()starts drawing. Try changingcolorto ‘red’!" - Interactive Step:
"Changelong_sideto 120 andshort_sideto 60. What shape do you get? Tell a friend!" - Exercise:
"Create variablesside_length(80) andmy_color("green"). Draw a square using a loop withforward(side_length)andright(90)four times." - Mini-Project: My Shape
- Task: "Pick a
size(e.g., 90) andmy_color(e.g., "yellow"). Draw a square or triangle with Turtle. Where should it start?" - Outcome: "Show your shape—amazing!"
- Task: "Pick a
- Topic: Let’s explore what variables can hold!
- Teaching Moment:
"Nice shapes! Variables can store different things—numbers, words, or yes/no. Let’s test them. Iscolora number? No, it’s a word! Let’s use a number for size instead." - Interactive Demo (turtle_types.py):
"I drew a circle. Should it be big or small? Let’s use a number for size!"- Kids: "Big!"
- Teacher: "Great! Let’s call it
circle_size—how about 80? Is that a word or number?" - Kids: "Number!"
- Teacher: "Yes! Now, what color—a word like ‘orange’?"
- Kids: "Yes!"
- Teacher: "Perfect! Let’s store it."
- Sample Code (turtle_types.py):
import turtle t = turtle.Turtle() t.shape("turtle") circle_size = 80 # A number (integer) for size color = "orange" # A word (string) for color is_big = True # Yes/no (boolean) to check size t.color(color) if is_big: t.circle(circle_size) print("Drew a big circle with size " + str(circle_size) + "!") else: t.dot(circle_size) # Small dot if not big turtle.done()
- Explanation:
"circle_sizeis a number (integer),coloris a string (words in quotes), andis_bigis a boolean (True/False).ifdecides what to draw. Iscolora number? No—try changingcircle_sizeto 50!" - Interactive Step:
"Setcircle_sizeto 60 andcolorto ‘purple’. Isis_bigTrue or False? Run it!" - Exercise:
"Useshape_size(70),shape_color("red"), andis_tall(False). Ifis_tall, draw a tall rectangle; else, a circle." - Mini-Project: Shape Experiment
- Task: "Pick a
size(number),my_color(word), andis_fun(True/False). Ifis_fun, draw a star; else, a circle." - Outcome: "Share your experiment!"
- Task: "Pick a
- Topic: Let’s make Turtle choose its drawing!
- Teaching Moment:
"You’re doing great! Let’s useifto let Turtle decide. Should it draw a big shape or small one? Let’s think together!" - Interactive Demo (turtle_if.py):
"I’m drawing a shape. Should it be big if the size is over 60?"- Kids: "Yes!"
- Teacher: "Cool! Let’s use
size—what number?" - Kids: "70!"
- Teacher: "Great! What color?"
- Kids: "Green!"
- Sample Code (turtle_if.py):
import turtle t = turtle.Turtle() t.shape("turtle") size = 70 color = "green" t.color(color) if size > 60: t.circle(size) print("Big circle drawn!") else: t.square(50) # Hypothetical, use forward/right for square print("Small shape!") turtle.done()
- Explanation:
"if size > 60checks the size. If true, it draws a circle; else, a square. Fix the square with a loop—addfor i in range(4): t.forward(50); t.right(90)!" - Interactive Step:
"Changesizeto 40. What happens? Why?" - Exercise:
"Usetemp(50). If above 40, draw a circle; else, a triangle withright(120)three times." - Mini-Project: Weather Art
- Task: "Use
temp(e.g., 45). If above 30, draw a sun (circle) in yellow; else, a snowflake (small squares)." - Outcome: "Show your weather art!"
- Task: "Use
- Topic: Let’s repeat drawings with loops!
- Teaching Moment:
"Fantastic choices! Loops make Turtle draw again and again. Should we draw 5 stars or 3? Let’s decide!" - Interactive Demo (turtle_loop.py):
"Let’s draw stars. How many?"- Kids: "4!"
- Teacher: "Awesome! What size for each?"
- Kids: "60!"
- Teacher: "Great! What color?"
- Kids: "Red!"
- Sample Code (turtle_loop.py):
import turtle t = turtle.Turtle() t.shape("turtle") num_stars = 4 star_size = 60 color = "red" t.color(color) for i in range(num_stars): for j in range(5): t.forward(star_size) t.right(144) t.penup() t.forward(100) t.pendown() turtle.done()
- Explanation:
"The outerforrepeatsnum_starstimes. The innerfordraws one star withright(144).penup()moves without drawing. Trynum_stars = 3!" - Interactive Step:
"Changestar_sizeto 40. How does it look?" - Exercise:
"Draw 3 hexagons (6 sides) withright(60)and asizeof 50, moving right each time." - Mini-Project: Loop Garden
- Task: "Draw 5 shapes (e.g., squares) with a loop, using
size(70) andcolor("blue"), moving right." - Outcome: "Show your garden!"
- Task: "Draw 5 shapes (e.g., squares) with a loop, using
- Topic: Let’s make reusable drawing spells!
- Teaching Moment:
"You’re loop experts! Functions let us reuse code. Should we draw a house or a tree? Let’s build a function!" - Interactive Demo (turtle_function.py):
"Let’s draw a house. What shape for the roof?"- Kids: "Triangle!"
- Teacher: "Great! What size for the base?"
- Kids: "100!"
- Teacher: "Cool! What color?"
- Kids: "Brown!"
- Sample Code (turtle_function.py):
import turtle def draw_house(t, base_size, color): t.color(color) for i in range(4): # Base t.forward(base_size) t.right(90) t.penup() t.goto(-base_size/2, base_size) t.pendown() for i in range(3): # Roof t.forward(base_size) t.right(120) t = turtle.Turtle() t.shape("turtle") draw_house(t, 100, "brown") t.penup() t.goto(150, 0) t.pendown() draw_house(t, 50, "green") turtle.done()
- Explanation:
"draw_housetakest,base_size, andcolor. We draw a square base and triangle roof. Trydraw_house(t, 80, "red")!" - Interactive Step:
"Add a newdraw_housecall with a different size and color. Where does it go?" - Exercise:
"Make adraw_star(t, size)function withright(144)five times. Call it with 40." - Mini-Project: House Village
- Task: "Create a
draw_housefunction. Draw 3 houses with different sizes and colors." - Outcome: "Show your village!"
- Task: "Create a
- Topic: Let’s use lists for colorful patterns!
- Teaching Moment:
"Nice village! Lists hold many values. Should we draw 4 shapes in different colors? Let’s plan it!" - Interactive Demo (turtle_list.py):
"How many shapes?"- Kids: "3!"
- Teacher: "Great! What sizes?"
- Kids: "50, 70, 90!"
- Teacher: "Awesome! What colors?"
- Kids: "Red, blue, yellow!"
- Sample Code (turtle_list.py):
import turtle t = turtle.Turtle() t.shape("turtle") sizes = [50, 70, 90] colors = ["red", "blue", "yellow"] for size, color in zip(sizes, colors): t.color(color) for i in range(4): t.forward(size) t.right(90) t.penup() t.forward(120) t.pendown() turtle.done()
- Explanation:
"sizesandcolorsare lists.zip()pairs them. The loop draws a square for each pair. Add a size and color!" - Exercise:
"Use lists for 3 sizes and colors. Draw triangles withright(120)." - Mini-Project: Rainbow Pattern
- Task: "Use lists for 4 sizes and colors. Draw circles, moving right each time."
- Outcome: "Share your rainbow!"
- Topic: Let’s make Turtle move with keys!
- Teaching Moment:
"You’re pattern pros! Let’s make Turtle a game character. Should it move up or down? Let’s decide!" - Interactive Demo (turtle_game.py):
"Which way should Turtle move first?"- Kids: "Up!"
- Teacher: "Great! What about down?"
- Kids: "Yes!"
- Sample Code (turtle_game.py):
import turtle t = turtle.Turtle() t.shape("turtle") def move_up(): t.setheading(90) t.forward(30) def move_down(): t.setheading(270) t.forward(30) turtle.listen() turtle.onkey(move_up, "Up") turtle.onkey(move_down, "Down") turtle.done()
- Explanation:
"setheading()turns Turtle.onkey()links keys to moves. Addmove_right()withsetheading(0)!" - Interactive Step:
"Add amove_rightfunction. Test it with ‘Right’!" - Exercise:
"Add a function to changet.color("purple")on ‘space’."
- Topic: Build and showcase your Turtle world!
- Teaching Moment:
"Time for your big project! Let’s create a Turtle race. Where should the finish line be? Let’s plan it!" - Interactive Demo (turtle_race.py):
"How many turtles?"- Kids: "2!"
- Teacher: "Great! What colors?"
- Kids: "Red, blue!"
- Exercise:
"Add a loop to draw a start line with 5 dots." - Mini-Project: Turtle Race Prep
- Task: "Set up 2 turtles with different colors and starting positions."
- Final Project: Turtle Race Game
- Sample Code (turtle_race.py):
import turtle import random # Set up screen screen = turtle.Screen() screen.title("Turtle Race") # Create turtles t1 = turtle.Turtle() t1.shape("turtle") t1.color("red") t1.penup() t1.goto(-200, 100) t2 = turtle.Turtle() t2.shape("turtle") t2.color("blue") t2.penup() t2.goto(-200, -100) # Race function def race(): while t1.xcor() < 200 and t2.xcor() < 200: t1.forward(random.randint(1, 20)) t2.forward(random.randint(1, 20)) if t1.xcor() >= 200: print("Red turtle wins!") else: print("Blue turtle wins!") race() turtle.done()
- Presentation: "Explain how your race works—variables, loops, and wins!"
- Outcome: A fun, visual race game.
- Sample Code (turtle_race.py):
- Interactive: "Which turtle should win? Let’s adjust the speed!"
- Encouragement: "You’re a Turtle champion! Keep creating!”
- Support: Help with setup and guide reasoning.