Pickles AcademyStart for free

Logical expressions – practice for Years 7–9

Sample questions on Logical expressions with the right answer and a worked solution, from easy to hard. In the Pickles Academy app a child gets new questions of the same kind every time, so they can't just learn the answers by heart.

Subject
Computing
Year
Years 7–9
Curriculum area
Algorithms and programming

Question types: True or false?

Rule: Logical expressions

and is true only when both parts are true. or is true when at least one is. not turns true into false and back.

First work out the comparisons (<, >, ==, !=), then not, then and, and or last.

Example: x = 3, y = 7: x < 5 and y < 5 is false, x < 5 or y < 5 is true

Watch out: == compares, = gives a variable a value. x != 3 is true when x is not 3.

Sample questions

  1. Question 1 Easy

    The variables have the values from the first lines. Decide for each expression whether it is true (YES) or false (NO).

    1. Expression 1
    2. Expression 2
    3. Expression 3
    Show the solution
    Answer:
    1. Expression 1 – yes
    2. Expression 2 – no
    3. Expression 3 – no

    How it works: 1. YES: 5 < 7 (true) 2. NO: [5 > 5 (false) and 7 > 5 (true)] 3. NO: [5 < 6 (true) and 5 > 7 (false)]

  2. Question 2 Normal

    The variables have the values from the first lines. Decide for each expression whether it is true (YES) or false (NO).

    1. Expression 1
    2. Expression 2
    3. Expression 3
    4. Expression 4
    Show the solution
    Answer:
    1. Expression 1 – yes
    2. Expression 2 – no
    3. Expression 3 – yes
    4. Expression 4 – no

    How it works: 1. YES: [5 <= 7 (true) and 7 >= 5 (true)] 2. NO: not 7 >= 5 (true) 3. YES: [5 <= 7 (true) or 7 >= 5 (true)] 4. NO: [5 >= 7 (false) and 7 >= 2 (true)]

  3. Question 3 Hard

    The variables have the values from the first lines. Decide for each expression whether it is true (YES) or false (NO).

    1. Expression 1
    2. Expression 2
    3. Expression 3
    4. Expression 4
    5. Expression 5
    Show the solution
    Answer:
    1. Expression 1 – no
    2. Expression 2 – yes
    3. Expression 3 – no
    4. Expression 4 – no
    5. Expression 5 – yes

    How it works: 1. NO: [[5 % 2 == 0 (false) or 7 + 8 > 12 (true)] and 7 % 2 == 0 (false)] 2. YES: not [7 % 2 == 0 (false) and 5 >= 8 (false)] 3. NO: [[5 % 2 != 0 (true) or 7 < 8 (true)] and 8 <= 7 (false)] 4. NO: [[7 % 2 == 0 (false) and 8 + 7 > 13 (true)] or 7 < 4 (false)] 5. YES: [[7 > 8 (false) or 5 + 7 < 13 (true)] and 5 < 7 (true)]

All Computing topics

Keep practising in the app

In a minute, your child has their own avatar and a first task. Free, no ads, data in the EU.

Start for free