# Lesson 1: Immediate Mode
This lesson introduces the python turtle commands. This lesson is intended to be completed in immediate mode.
Be aware that some students will race through this and continue with lesson 2. That's fine.
* Starter
* Are the students aware that apps and games are written using different programming languages? Explain that we are going to learn Python, one of the most popular languages in the world.
* Demonstration
* Demonstrate turtle commands
* Ask the students how you could draw a square.
* Discuss the arguments (the numbers in the brackets). What would happen if you changed them? Do you think that there is a turtle.left() command?
* Demonstrate turtle.home() and turtle.clear()
* Now demonstrate drawing a triangle. Discuss the angle required at the corners.
* Activity
* Ask the students to draw a square, rectangle and/or triangle themselves. Get them to draw different sizes. Get more able students to draw pentagons, hexagons and so on.
* Ask the students what they think the different commands do. Demonstrate a few of them.
* Drawing Shapes
* Get them to draw some of the shapes. For the less able give the pictures of the shapes to be drawn. For the more able, give word descriptions
* Plenary
* The code draws a letter b
# Lesson 2: For Loops
Introduce programming v immediate mode
For Loops
* Starter
* Students should complete the shapes in immediate mode
* Activity: Draw a square or rectangle
* Recap last lesson's shapes. Impress upon students the fact that what they did last lesson wasn't programming, they were doing things in the immediate mode. This lesson we'll be programming.
* Demonstrate how to open a file in IDLE and to write the code for a square. Discuss why this is harder than immediate mode (you have to plan ahead)
* Get them to write programs to draw a rectangle and triangle by programming.
* Demonstrate to how to submit work for coding: screenshots of code and output.
* Stress that code must be screenshots and not cut and paste text.
* Stress that most of the marks awarded in tests and exams will go for the code and not the output
* Activity: For Loops
* Discussion: Drawing a square above requires a lot of cut and paste code: always a sign that there is a better way of doing things. Here's one way using for loops.
* Explain the for and range commands and stress the importance of indenting.
* What would you change to draw a square with sides twice as long?
* How would you draw a triangle? What would the angle be? Why?
* Get the students to draw a triangle.
* Exercise
* The rule for the angle of turn is 180 - 360/n where n is the number of sides. Some of the students will know this or be able to work this out for themselves
# Lesson 3: Functions and Loops
Reusing code using functions.
* Starter
* Remind the students about indenting when drawing a for loop. You might want to demonstrate this.
* Activity
* Demonstrate the code given in the powerpoint
* Point out the indentation and the fact that the function won't run until it's called. Stress the difference between function definition and function call
* Stress the importance of naming the function sensibly. You could mention Python naming conventions: use underscores as\_shown\_here()
* Exercise
* Refer the students to the previous lessons for the angles needed for the shapes
* Calling a function repeatedly
* Do this if you have time. It can be adjusted to make nice shapes.
# Lesson 4: Using Functions
Drawing shapes using functions
This lesson sacrifices efficiency for ease of understanding. Students may point out there are better ways to draw the shapes.
I've included the Python code below
![[Lesson 4 First Attempt at House.py]]![[lesson 4 House.py]]
* Starter
* Note that the function isn’t called. Students need to add call to square() at the end of the code.
* Using Functions to draw shapes
* Remind the students about the pen up and move commands.
* Work with the class to move the roof to the top of the house
* Drawing a house
* Last week we looked at defining functions to reuse code. We’re now using those functions to draw more complicated shapes
* Plenary
* Students should recognise that there are two shapes, a black and a white triangle, and that one is upside down with respect to the other
* Where will the turtle finish when it has drawn a triangle? Will you need to move it to draw the next.
# Lesson 5: Functions and For Loops
Interleaving concepts taught so far
I've included the Python Code for the activity below
![[lesson 5.py]]
* Starter
* Should be quite straightforward
* Activity
* I've included the Python code from the slide below
* Discuss the constant side. Point out that constants are named in capitals. Demonstrate what happens when you change SIDE
* Explain the need to move after drawing each triangle (this should recap last lesson's plenary)
* Exercise
* There's an extension for those who need it...
# Lesson 6: Putting it all Together
Interleaving again
* Starter
* Note: there are lots of ways to describe how you would draw the chessboard. We are looking for an understanding that there are two basic shapes (a black and white square) and different sorts of repetition
* Activity
* Here's the code from the slide
![[Lesson 6 chess 1.py]]
* And here's a little helper for those who need it.
![[Lesson 6 chess helper.py]]
* Some students may find a more efficient way of drawing the board (there are lots of ways)
* Some will need a lot more help to do this exercise
* There is an extension for those who finish
* Plenary
* Examples include
* Only draw the black squares
* Draw 2 x 2 squares and join them together to make 4 x4 squares, then join them together
* Use a flip flop, not forgetting to flip flop again at the end of each row...