Lesson 1 of 0
In Progress

Session 6: Conditional Programming

Objectives

After this lesson, students will be able to:

  • Describe about different control flow structures in Python.
  • Describe about if-else statement in python.
  • Implement if-else statement logic in Python codes.
  • Prepare code for a grade calculator.
  • Identify different types of logical operators in python.
  • Analyse the problem, decide and evaluate conditions.
  • Prepare code for identifying whether a given shape is triangle or not.
Introduction

In this session, students will be learning about what is Conditional Programming. How decision making in a programming language is automated using conditional statements.

Students are given introduction to Control flow structure. The different types of control structures in programming. They are taught how to analyse a given conditional statement. They are also explained how to use an if-else conditional statement in a program. Then, we give them step-by-step guide to make a ‘grade calculator’. After this, they are taught about different logical operators in Python. Finally, we give them a step-by-step guide to identify ‘whether a given shape is triangle or not’.

Activity
  • Create a project which calculates grades.

  • Create a project which identifies whether a shape is a triangle or not

Teaching Resources
PicoBlox Code
TitleDescriptionFile
Grade calculatorThe project demonstrates a grade calculatorhttps://learn.edustream.ae/wp-content/uploads/2022/06/CL9_CH6_grade-calculator_activity.sb3
Is it a triangle?The project demonstrates whether a shape is a triangle or nothttps://learn.edustream.ae/wp-content/uploads/2022/06/CL9_CH6_Is-it-a-triangle-or-not_activity.sb3
Timeline
TitleApproximate DurationProcedureReference Material
Control flow structure5
  1. Introduce about what is conditional programming ?
  2. Access and play the Control flow structure Lecture Slide.
  3. What is if-else control statement ?

Lecture Slide

Activity : Grade calculator15
  1. Ask students to open the PictoBlox on their computer.
  2. Demonstrate the procedure given in the Grade Calculator Activity Sheet to the students.
  3. Ask the students to follow the instructions to create the project.
  4. 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

Logical Operators5
  1. Discuss about what are logical operators ?
  2. Access and play the Logical operators Lecture Slide.
  3. Explain how logical operators are used while writing a code in python programming language.

Lecture Slide

Activity: Is it a triangle ?10
  1. Demonstrate the procedure given in the Is it a triangle Activity Sheet to the students.
  2. Ask the students to follow the instructions to create the project.
  3. 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.
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.