True or false values

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

True or false values

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which value is a true/false (Boolean) value?
A maybe
B true
2. Which question can be answered with a Boolean?
A Is the light on?
B What is your favourite colour?
3. How many different values can a Boolean have?
A As many as you like
B Two: true and false
4. A light switch is on. Which Boolean value shows this for 'Is the light on?'
A true
B false
5. A Boolean is most like which pair of binary ideas?
A On and off
B Red, green and blue

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1lightOn = true AStores the answer yes to the question 'is the light on?'
2isRaining = false BA Boolean can only be true or false. 'maybe' is a third value, so it is not allowed. Use true or false.
3A Boolean can only ever be one of two values, like on and off in binary CStores the answer no to the question 'is it raining?'
4A Boolean stores the answer to a yes/no question DdoorOpen = true
5lightOn = maybe EThe quote marks make it text, not a Boolean. Write true without quotes.
6isSunny = "true" Ftrue or false

Definitions

Boolean

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
light = ____
2.
raining = _____
3.
bigger = 5 _ 3
4.
light = True print(_____)
5.
same = 7 __ 7

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A light_on = True
B door_open = Falce
C print(light_on)
Question 2
A is_raining = False
B print(is_raining)
C has_pet = Yes
Question 3
A switch_on = True
B if switch_on
C print("Light is on")
Question 4
A is_open = True
B is_full = False
C print(is_open)
D print(is full)
Question 5
A is_day = True
B is_night = not is_day
C print(is_day)
D print(is_nigth)

Answer Key

True or false values
Section A: Quick Questions
Q1
B — true
Q2
A — Is the light on?
Q3
B — Two: true and false
Q4
A — true
Q5
A — On and off
Section B: Match the Pairs
Q1
lightOn = true → Stores the answer yes to the question 'is the light on?'
Q2
isRaining = false → Stores the answer no to the question 'is it raining?'
Q3
A Boolean can only ever be one of two values, like on and off in binary → true or false
Q4
A Boolean stores the answer to a yes/no question → doorOpen = true
Q5
lightOn = maybe → A Boolean can only be true or false. 'maybe' is a third value, so it is not allowed. Use true or false.
Q6
isSunny = "true" → The quote marks make it text, not a Boolean. Write true without quotes.
Section C: Definitions
Q1
Boolean — A data type with only two possible values: true or false. It stores the answer to a yes/no question, like 'is the light on?', just like on and off in binary.
Section D: Fill in the Blanks
Q1
light = True
Q2
raining = False
Q3
bigger = 5 > 3
Q4
light = True print(light)
Q5
same = 7 == 7
Section E: Spot the Error
Q1
B — A Boolean can only be True or False, and Falce is a typo. Line 2 should be door_open = False.
Q2
C — A Boolean can only be True or False. Yes is not a Boolean value, so line 3 should be has_pet = True.
Q3
B — An if line needs a colon at the end. Line 2 should be if switch_on:
Q4
D — A variable name cannot have a space in it. The name is is_full with an underscore, so line 4 should be print(is_full).
Q5
D — The variable name is misspelled. The Boolean was made as is_night, so line 4 should be print(is_night).