How to use the
Learning Portal

Learning Portal

Our hands-on, comprehensive lesson plans span a range of levels. Browse our free STEM and coding learning resources.

Marty Image

1.10 – Introduction to Logic Operators

45 Minutes

Lesson Overview

When we make decisions, there is usually more than one thing that we have to take into consideration. For example, if I have homework AND I have swimming lessons then I won’t have time to watch cartoons. In this lesson, students will explore the different ways that we can represent this whilst programming to help Marty make more difficult and informed decisions.

Key vocabulary:
    If statements, Repeat/Loops , Logic , Operators , Condition , Decisions,

Content Sections

  • Learning Objectives
  • Extensions & Challenges
    • Additional Reading
    • 1.10 – Introduction to Logic Operators

      45 Minutes

      Lesson Overview

      When we make decisions, there is usually more than one thing that we have to take into consideration. For example, if I have homework AND I have swimming lessons then I won’t have time to watch cartoons. In this lesson, students will explore the different ways that we can represent this whilst programming to help Marty make more difficult and informed decisions.

      Key vocabulary:
        If statements, Repeat/Loops , Logic , Operators , Condition , Decisions,
      • Lessons 1.1-1.9
      • Laptop, PC or Tablet
        • Marty the Robot
        • Marty Workbook (Lesson 1)
        • Laptops/Computers/Tablets
        • Access to the Scratch editor

      Learning Objectives

      • Understand that we can represent one thing in many different ways whilst programming
      • Use AND, OR and NOT in if statements or loops
      • Describe when to use AND, OR and NOT logical operators
      • Predict what will happen in small programs that use AND, OR and NOT logical operators

      1. Recap of if statements by giving a few examples and asking students to predict what they think will happen

      2. Moving on to begin considering when we make decisions where we have to take more than one thing into consideration, ask students to think up some after giving a few examples

      3. Introducing examples of how we would use AND, OR and NOT into our if statements

      4. Given some examples, ask students to predict what they think will happen, exploring different use cases of AND, OR and NOT logic operators

      5. Going into small groups with one Marty per group, students will complete a programming task where they have been asked to write a program to help Marty make good decisions when he has to think about more than one thing

      a. Gradually building up their program to include the different logic operators based on the question and decision that has to be made

      6. Short fill in the blank task where students have to suggest which logic operator should be placed into the space, building up an understanding of differentiating between the operators and when to use them

      Extensions & Support

      • Students could create some challenge cards of different scenarios and decisions that have to be made, pass to another team group and see if they can create a program to help Marty make that decision

      Additional Reading

      • Educator’s Guide
      • Introduction to Programming with Marty using Scratch