Lesson Plan 6: The While loop in Python



Lesson Plan 6: The While loop in PythonCourse: KS3 ComputingSession: 6 of 10Date: Jan/Feb 2018Lesson aims and outcomesIn this lesson we will introduce the while loop using PythonYou should learn to use a while loop in a Python programYou will learn to trace a program to keep track of what it is doingTeachers notesWhen introducing the While loop this is a good time to spend time on investigating how the code works in detail – using a tracing method developed by CAS Scotland called TRACS. The version used here has been adapted for use for PRIMM. After a short starter the students follow a demo and firstly identify what the computer needs to compute (which we call expressions), then draw in the flow of control, and then trace through the program keeping track of the values of the variables. Structure of sessionTimeActivityResources0- 5 minsArrival and settling5-15 minsStudents predict what the starter program will do. They then download the starter program and see if it did what they thought it would. Activity Sheet 6a15-30 minsTRACS activityprint full size slides of both slides for each pair/individualstudents fill in the first one while teacher steps through on the boardstudents then do the second one on their ownMore TRACS examples can be found on the CAS websiteThese resources come from CAS Scotland originally but the mini version has been adapted for PRIMMPrint mini-tracs_to_print as 2 full-size slides for each pair/individual.Use the mini_tracs_complete to demo.30 – 55 minsProgramming exercisesThese exercises will take the rest of the lesson and focus on the Make aspect of PRIMM as students are making their own small programs (although they start by modifying the starter program). Activity Sheet 6c55 – 60 minsReview – What do the terms selection iteration and sequence mean and can students find an example. Lesson 6 slides ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download