Core Concepts (Week 3)
- Libraries in Python
- For Loops (Introduction)
- Graphics in Python
- Variable Denotion
Overview
Turtle is a built-in library in Python that lets users create a variety of shapes and designs through a virtual canvas.
It is an exciting way for students to develop the rudimentary concepts of Python, while simultaneously introducing them to libraries with a variety of built-in methods and functions.
Reference: https://docs.python.org/3.3/library/turtle.html?highlight=turtle#turtle.filling
WEEKDAY CONTENTS
- Introduction [5 minutes]: Libraries
- Weekday Lesson #1 [15 minutes]: Turtle Module
- Weekday Lesson #2 [15 minutes]: For Loops
- Weekday Activity / Homework [15 minutes]: Draw your own Shapes!
Weekday Introduction: Libraries
- Link: https://trinket.io/python/88dd6c94d1
- Showcases a beautiful drawing that was generated using the Turtle module.
- Present the code’s functionality (clicking on the canvas), and highlight the different built-in functions of the module. Also discuss the wide range of libraries accessible to Python users, and some of your favourites.
Weekday Lesson #1 — Turtle Module
- Link: https://repl.it/@thipesehanbalak/turtlelesson
- Show them the basic aspects of the Turtle library.
- Ensure that the students understand each of the fundamental built-in functions, like pendown(), forward() / backward(), left() / right(), goto(), etc.
- Individual Activity: Have them create a square (or any shape) with different colors, and make sure they fill the square in with a color.
- An example of a basic code that draws a colourful square is shown below:
Weekday Lesson #2 — For Loops
- Introduce the students to for loops. Show them what a basic foor loop does, and discuss its various applications.
- Individual Activity: Have them create a basic for loop based on conditions they create. Make sure they try out in range(), nested for loops, etc.
Weekday Activity / Homework— Draw Multiple Shapes
- As an activity, have them make you a multitude of specific shapes.
- You can make them draw a set of shapes in different positions with a variety of colours, and have them use the different built-in functions.
- Example: Draw a triangle, inside a square, inside a pentagon, inside a hexagon, inside a octagon, all with different colours and each using a for loop.
WEEKEND CONTENTS
- Concept Review [10 minutes]: Turtle Module and For Loops
- Review Homework [5 minutes]: Drawing Multiple Shapes
- Weekend Project [30–40 minutes]: Creative Art using Turtle Module
Weekend Introduction — Concept Review
- Have the students discuss the Turtle module from the weekday lesson
- Have the students discuss the For Loop concepts from the weekday lesson
Weekend Review — Drawing Multiple Shapes
- Have each student present their shape drawing from the weekday lesson
- Demonstrate the code example and show what they could’ve done instead. Have them discuss your code amongst each other.
- Link: https://repl.it/@thipesehanbalak/turtleactivity
Weekend Project — Creative Art using Turtle Module
- Link: https://trinket.io/python/88dd6c94d1
- Give them 30–40 minutes to program their own unique design individually.
- Revisit the design you showed them during the weekday lesson, to re-iterate the potential of the Turtle library.
- Make sure that you are enforcing the utility of for loops, built-in functions of the Turtle module, user inputs, and general commenting of their code.
- When they are finished their work, have them present each of their designs.
- During their individual presentations, you want to make sure that they highlight their choice of formatting, presentation, and overall design.
Weekend Homework — Review Turtle & For Loops
- For homework, have students create a new drawing based on what they saw from one another’s designs.
- Remind them that using a variety of for loops will make their code simpler and more efficient.