Lesson 1 of 0
In Progress

Session 7: Loops in Python – While Loop

Objectives

After this lesson, students will be able to:

  • Define different types of loops available in python.
  • Describe about the usage, and working of a loop.
  • Analyse and decide on an appropriate combination of Loops and Conditions.
  • Prepare a coding project on number counter using quarky.
Introduction

In this session, students will be learning about, the while loop concept and how while loops can be used in different situations. How they can design simple applications having iterative nature.

Students are introduced to the concept of loops in python. The benefits of using loops in programming, and what are various loops available in python programming language. Students are then taught how they can write a code using the concept of while loop and create applications on their own. Finally, we give them a step-by-step guide to make a project using Quarky along with PictoBlox. They will be creating a project on number counter using Quarky.

Activity
  • Creating a project that uses Quarky to count numbers from ‘1-9’ and from ‘9-1’ using the concept of while loop.

Teaching Resources
PicoBlox Code
TitleDescriptionFile
Number counter using QuarkyThis project demonstrates how number counter can be made using quarkyhttps://learn.edustream.ae/wp-content/uploads/2022/06/CL9_CH7_Number-counter-using-quarkycombined-code.sb3
Timeline
TitleApproximate DurationProcedureReference Material
Introduction to loops5
  1. Access and play the Introduction to Loops Lecture Slide.
  2. Explain about increment loops.
  3. What are benefits of loops ?
  4. Give an overview of different types of loops available in python.

Lecture Slide

While loop10
  1. Access and play the While Loop Lecture Slide.
  2. Explain the general flow of while loop.
  3. Describe the syntax of while loop.
  4. Give example of a code using while loop and explain the various observations made from it.

Lecture Slide

Activity: Number counter using Quarky20
  1. Guide students, step by step for connecting to Quarky from PictoBlox in their respective devices.
  2. Also make sure that each student connects to their own device via bluetooth and not someone else’s device.
  3. Demonstrate the procedure given in the Number counter using Quarky Activity Sheet to the students.
  4. Ask the students to follow the instructions to create the project.
  5. At the end of the activity, the teacher must check if all the students have created the project and provide feedback accordingly.

PictoBlox file, Lecture Slide and Activity sheet

Concluding the lecture5
  1. Make sure that all the students save their script properly before closing PictoBlox.
  2. Give a summary of the points covered in the lecture.

Lecture Slide

Things to Remember
Before Class
  1. Make sure each PC has the latest version of PictoBlox installed and running.
  2. Make sure all the Quarky robots are in working condition and are fully charged.
  3. Make sure all the Quarky robots have a working USB cable with them. If you are using Bluetooth to connect Quarky with PictoBlox, make sure that you have downloaded the PictoBlox Link and it stays well connected.
  4. Make sure that all the devices running PictoBlox has a working webcam as well as bluetooth.
During Class
  1. Make sure they write the script by selecting the appropriate sprite.
  2. Make sure they use the right palettes of Pictoblox Python interface for different functions while writing the code.
After Class
  1. Make sure students save their codes/scripts.
  2. Make sure they shut down the PC/Laptops.
  3. Make sure they return Quarky and USB cable in good condition.