GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.26

Computational thinking and programming

Choose data types and recognise Boolean literals

Read a little. Try the workbook. Check your answers. Choose one section below to get started.

Topic 1.26 · Choose data types and recognise Boolean literals10 fillable worksheet pagesRead at your own pace

LET’S TRACE, REASON AND TEST

Choose data types and recognise Boolean literals

Choose a data type according to meaning and operations. Integers represent whole numbers, floating-point numbers represent many decimal values approximately, strings represent text, and Boolean values are True or False.

Today’s two goals
  • Classify values by meaning and distinguish quoted Boolean-looking text.
  • Explain my method and support it with a labelled trace, example or test record.
Original PaxaKids illustration for Choose data types and recognise Boolean literals. Use the supplied program and data models for precise workbook facts.
An original PaxaKids workbook scene. Use the supplied programs and data for precise workbook facts.

Work through an example

A fictional item count of 6 can be an integer; a label "06" is text when its leading zero matters. True is a Boolean literal, while "True" is a nonempty string.

Try before your workbook

Are False and "False" the same Python value or type?

Explore the clues

Tap one card to find out more.

Understand the idea

Choose a data type according to meaning and operations. Integers represent whole numbers, floating-point numbers represent many decimal values approximately, strings represent text, and Boolean values are True or False.

Concept to practise: Choose data types and recognise Boolean literals.

Work through an example

A fictional item count of 6 can be an integer; a label "06" is text when its leading zero matters. True is a Boolean literal, while "True" is a nonempty string.

Try before your workbook

Are False and "False" the same Python value or type?

Check my readiness thinking

No. False is a Boolean value; "False" is a string containing five characters. The distinction affects comparisons and conversion.

Your original programs and learning models

These original PaxaKids program and data models support your workbook. Some examples deliberately contain faults to investigate. Follow their headings and preserve exact code case, punctuation and order. Traces and supplied records are not claims of physical testing.

Choose a type from the meaning of the data

The right data type depends on what a value means and what the program must do with it. A count needs numerical operations; a code may need leading zeroes preserved; a state can be True or False.

Python’s Boolean literals are exactly True and False, with capital first letters and no quotation marks. Quoted "True" and "False" are text, so their type is string.

Connect general types to Python names

Integer values are whole numbers, including negative whole numbers. A real-valued measurement can use Python float, which represents many fractional values approximately. A string stores text, including an empty string. Boolean data stores one of two states.
Connect general types to Python names — original model
General typePython nameOriginal example
Integerint-3; 0; 18
Real / decimal numberfloat1.75; 23.5
Stringstr"0042"; "ready"; ""
BooleanboolTrue; False

Identify the data in a total-and-mean algorithm

Two fictional teams collected 18 and 29 parcels. The counts are whole numbers, while their mean can have a fractional part. The two message variables hold words, not numeric values.
Original Paxa pseudocode retrieval task
first_count = 18
second_count = 29
total_label = "Combined:"
mean_label = "Mean per team:"
combined = first_count + second_count
mean = combined / 2
OUTPUT total_label, combined
OUTPUT mean_label, mean

Complete the algorithm’s six-field data dictionary

Use page 3 and choose int, float, str or bool. In the corresponding Python program, / is true division, so mean uses float even when a different pair of counts would give a whole-number average.
Complete the algorithm’s six-field data dictionary — original model
VariableStored valuePython type
first_count18{'clue': 'int / float / str / bool', 'prompt': 'Type of first_count', 'answers': ['int', 'integer']}
second_count29{'clue': 'int / float / str / bool', 'prompt': 'Type of second_count', 'answers': ['int', 'integer']}
total_label"Combined:"{'clue': 'int / float / str / bool', 'prompt': 'Type of total_label', 'answers': ['str', 'string']}
mean_label"Mean per team:"{'clue': 'int / float / str / bool', 'prompt': 'Type of mean_label', 'answers': ['str', 'string']}
combined47{'clue': 'int / float / str / bool', 'prompt': 'Type of combined', 'answers': ['int', 'integer']}
mean23.5{'clue': 'int / float / str / bool', 'prompt': 'Type of mean', 'answers': ['float', 'real']}

Distinguish Boolean values, numbers and quoted text

These are actual Python literals. Choose their exact type, not their possible conversion. Quotation marks make text; a capitalised Boolean literal without quotes has type bool. The integer 0 is not written as a Boolean literal.
Distinguish Boolean values, numbers and quoted text — original model
Python literalExact type
True{'clue': 'int / float / str / bool', 'prompt': 'Literal type True', 'answers': ['bool', 'Boolean']}
"True"{'clue': 'int / float / str / bool', 'prompt': 'Literal type "True"', 'answers': ['str', 'string']}
False{'clue': 'int / float / str / bool', 'prompt': 'Literal type False', 'answers': ['bool', 'Boolean']}
"False"{'clue': 'int / float / str / bool', 'prompt': 'Literal type "False"', 'answers': ['str', 'string']}
0{'clue': 'int / float / str / bool', 'prompt': 'Literal type 0', 'answers': ['int', 'integer']}
"0"{'clue': 'int / float / str / bool', 'prompt': 'Literal type "0"', 'answers': ['str', 'string']}

Classify six complete original data sets

Choose one Python type for every row as written. Quoted items are strings. Row 4 includes one space character. Row 5 contains genuine Boolean literals; row 3 contains words, including perhaps, so it cannot be stored as one set of Boolean states.
Classify six complete original data sets — original model
SetFive original valuesType
118, 3, 7, 42, 6{'clue': 'int / float / str / bool', 'prompt': 'One type for dataset 1', 'answers': ['int', 'integer']}
2'hello', '0007', 'later', 'no!', 'ok'{'clue': 'int / float / str / bool', 'prompt': 'One type for dataset 2', 'answers': ['str', 'string']}
3'TRUE', 'False', 'perhaps', 'true', 'wait'{'clue': 'int / float / str / bool', 'prompt': 'One type for dataset 3', 'answers': ['str', 'string']}
4'H', '2', '?', ' ', 'Q'{'clue': 'int / float / str / bool', 'prompt': 'One type for dataset 4', 'answers': ['str', 'string']}
5False, True, False, True, True{'clue': 'int / float / str / bool', 'prompt': 'One type for dataset 5', 'answers': ['bool', 'Boolean']}
6'0042', 'K8', '2.5m', '17A', '6cr'{'clue': 'int / float / str / bool', 'prompt': 'One type for dataset 6', 'answers': ['str', 'string']}

Keep identification separate from arithmetic

A fictional equipment code is "0012". Its leading zeroes are part of the identifier. A quantity of 12 is a number. Converting the code with int("0012") produces numeric 12 and loses those leading zeroes; that is appropriate only if numerical meaning is intended.
Original Paxa code and count examples
equipment_code = "0012"
quantity = 12
measurement = 12.0
available = True

Plan types for a fictional mission record

This original record is a small preparation for later Boolean flags. It does not require running a gate program yet. Store a team code unchanged, add token counts numerically, allow a fractional mass and record a state as a Boolean.
Plan types for a fictional mission record — original model
MeaningExample valuePython type
Exact team code"Lark-04"{'clue': 'int / float / str / bool', 'prompt': 'Mission team code type', 'answers': ['str', 'string']}
Count of tokens12{'clue': 'int / float / str / bool', 'prompt': 'Mission token count type', 'answers': ['int', 'integer']}
Mass in kilograms1.75{'clue': 'int / float / str / bool', 'prompt': 'Mission mass type', 'answers': ['float', 'real']}
Permission stateTrue{'clue': 'int / float / str / bool', 'prompt': 'Mission permission type', 'answers': ['bool', 'Boolean']}

Files for this activity

Use these original PaxaKids practice files with the matching workbook. Work on a local copy in the appropriate editor. Some examples deliberately contain faults to investigate; a downloaded file is not a completed practical test.

Paxa the Fox

Try one step with Paxa!

Trace code in the stated order and preserve exact spelling and case. Use fictional data. Label a prediction, paper trace, simulator run and physical-device test separately; an unperformed test stays Pending. Save personal responses before leaving.

Our Unit 1 learning path
  1. Lesson 1.1: Recall algorithms and representations
  2. Lesson 1.2: Purpose and conventions of pseudocode
  3. Lesson 1.3: Input, output and strings
  4. Lesson 1.4: Identifiers and assignment
  5. Lesson 1.5: Arithmetic and translation
  6. Lesson 1.6: Trace and review a sequence
  7. Lesson 1.7: Conditions and two-way flow
  8. Lesson 1.8: IF THEN and indentation
  9. Lesson 1.9: IF THEN ELSE and decision diagrams
  10. Lesson 1.10: Ordered ELSEIF and fallback ELSE
  11. Lesson 1.11: Match flowchart and pseudocode branches
  12. Lesson 1.12: AND, OR and NOT
  13. Lesson 1.13: Grouping, precedence and review
  14. Lesson 1.14: Why software searches
  15. Lesson 1.15: A successful linear search
  16. Lesson 1.16: An unsuccessful search and termination
  17. Lesson 1.17: Practise and communicate the search
  18. Lesson 1.18: Translate conditions into Python
  19. Lesson 1.19: One-branch IF programs
  20. Lesson 1.20: Two-way IF ELSE programs
  21. Lesson 1.21: Ordered ELIF choices
  22. Lesson 1.22: Ranges and independent decisions
  23. Lesson 1.23: Boolean operators in Python
  24. Lesson 1.24: Design and test recommendations
  25. Lesson 1.25: Trace, debug and reflect
  26. Lesson 1.26: Choose data types and recognise Boolean literals
  27. Lesson 1.27: Set and use Boolean flags
  28. Lesson 1.28: Explain and identify constants
  29. Lesson 1.29: Express constants in three algorithm forms
  30. Lesson 1.30: Use a fixed factor in a calculation
  31. Lesson 1.31: Cast to Boolean and validate an empty response
  32. Lesson 1.32: Recall calls and trace return values
  33. Lesson 1.33: Supply parameters and reuse library code
  34. Lesson 1.34: Choose and import libraries responsibly
  35. Lesson 1.35: Round with floor and ceiling
  36. Lesson 1.36: Use pi and investigate another mathematical feature
  37. Lesson 1.37: Generate random choices within bounds
  38. Lesson 1.38: Investigate random real values and review library use
  39. Lesson 1.39: Retrieve test tables and predict selection outcomes
  40. Lesson 1.40: Decompose everyday problems
  41. Lesson 1.41: Decompose programs and organise shared work
  42. Lesson 1.42: Develop through repeated build/test cycles
  43. Lesson 1.43: Predict and verify algorithm outcomes
  44. Lesson 1.44: Choose representative and boundary tests
  45. Lesson 1.45: Build, execute and review a test plan
  46. Lesson 1.46: Recall physical inputs and compare transmission media
  47. Lesson 1.47: Configure a radio group and agree a message scheme
  48. Lesson 1.48: Send and receive numbers and strings
  49. Lesson 1.49: Trace numeric message sequences
  50. Lesson 1.50: Transmit text and use received data in conditions
  51. Lesson 1.51: Diagnose and extend a message protocol
  52. Lesson 1.52: Review communication and evidence of testing
  53. Lesson 1.53: Project 1: Adventure story
  54. Lesson 1.54: Project 2: Fire, Water, Earth
  55. Lesson 1.55: Check your progress 1
For grown-ups: using this lesson

Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.

Read one explanation, discuss the model and try the readiness check before the workbook. Choose “Mark lesson finished” when ready. Optional account progress saves lesson position and completion across devices; save personal responses before leaving.

2. Fill in your workbook

Read the teaching and complete workbook instructions. Choose, write or draw; Answer list offers larger controls. Trace code precisely and distinguish predictions from actual tests. Review designs, explanations and drawings with a grown-up.

Choose data types and recognise Boolean literals10 student pages · original artwork

Opening your PDF…

Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.

TAKE YOUR PRACTICE OFFLINE

3. Download the student worksheet

All 10 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.

Student worksheet only · PDF · 8.4 MiB · No answer key included

Download worksheet PDF ↓

TRY FIRST, THEN CHECK TOGETHER

Download the student worksheet →

4. Answers & guidance

Finished your try? Open the guide and compare one worksheet at a time. Your own words may be different and still explain the right idea.

Shown on this webpage only. There is no answer-key download, and this guide is left out when printing the page.

Show answers for all 10 worksheets

Worksheet 1

  1. Question 1: Why might a numeric-looking label need a string? its exact characters and leading zeroes matter
  2. Question 2: Which is a Python Boolean literal? True

Worksheet 2

  1. Question 3: How does Python represent a single character such as "Q"? as a string of length one
  2. Question 4: What does a float type promise? a floating-point numeric representation

Worksheet 3

  1. Question 5: What value is stored in combined? 47
  2. Question 6: What value is stored in mean? 23.5
  3. Question 7: Which variable contains a message string? mean_label

Worksheet 4

  1. Question 8: Type of first_count int / integer
  2. Question 9: Type of second_count int / integer
  3. Question 10: Type of total_label str / string
  4. Question 11: Type of mean_label str / string
  5. Question 12: Type of combined int / integer
  6. Question 13: Type of mean float / real

Worksheet 5

  1. Question 14: Literal type True bool / Boolean
  2. Question 15: Literal type "True" str / string
  3. Question 16: Literal type False bool / Boolean
  4. Question 17: Literal type "False" str / string
  5. Question 18: Literal type 0 int / integer
  6. Question 19: Literal type "0" str / string

Worksheet 6

  1. Question 20: One type for dataset 1 int / integer
  2. Question 21: One type for dataset 2 str / string
  3. Question 22: One type for dataset 3 str / string
  4. Question 23: One type for dataset 4 str / string
  5. Question 24: One type for dataset 5 bool / Boolean
  6. Question 25: One type for dataset 6 str / string

Worksheet 7

  1. Question 26: Which variable should preserve the exact four-character identifier? equipment_code
  2. Question 27: Which value is a float literal? 12.0
  3. Question 28: Which value is a string even though it resembles a number? "12.0"

Worksheet 8

  1. Question 29: Mission team code type str / string
  2. Question 30: Mission token count type int / integer
  3. Question 31: Mission mass type float / real
  4. Question 32: Mission permission type bool / Boolean
  5. Question 33: Which reason supports using bool for permission? only the two states True and False are needed

Worksheet 9

  1. Question 34: Explain the six data-type choices in the page 3 algorithm, including both message variables and the mean. Then explain your classifications for all six rows on page 6. Address the mixed word row, the one-character row, genuine Boolean states and codes with leading zeroes or units. Compare with a partner if available, discussing any alternative representation and what purpose would justify it. Otherwise label an individual review. Record a correction or explain why you kept your answers, supported by the values and intended operations. Algorithm: first_count/second_count/combined int; total_label/mean_label str; mean float/real because division can yield a fractional result and Python / returns float for these integer operands. Dataset types in order int,str,str,str,bool,str; mixed perhaps cannot be genuine Boolean state set; single characters including space use Python length-one str; leading-zero/unit codes remain str as written. Alternative representation only when purpose/conversion policy changes and information preserved. Require reasons and honest partner versus individual discussion, actual correction if any or evidence for unchanged choice. No numerical marks or fabricated activity. Grown-up review; personal evidence is required.

Worksheet 10

  1. Question 35: Design a fictional equipment or mission record with at least six named fields. Include a leading-zero code, an integer count, a fractional measurement, a text message, one genuine Boolean state and one text field that contains the word True or False. For each field give a realistic example, meaning, Python type and intended operation or use. Explain why the Boolean state and Boolean-looking text have different types. Explain how the code would be damaged by an unnecessary number conversion. Use invented data only and cite an attached full data dictionary if needed. At least six meaningful named fields meeting all requested roles: leading-zero string, int count, float measurement, str message, bool state unquoted True/False and str text "True"/"False". Explicit purpose/operations and coherent examples, correct Python names or accepted general equivalents. Distinguish literal state from quoted text rather than relying only on visible words. Unnecessary int conversion removes leading-zero formatting; exact identifiers preserved. Python single-character fields remain str if used. Complete legible dictionary or cited actual file, fictional inputs and evidence-based explanation, no unperformed program execution claim. Grown-up review; personal evidence is required.
Back to my workbook ↑

Curriculum & workbook reference

Computing for your homeschool day

Explore Choose data types and recognise Boolean literals with this free Grade 8 Computing lesson. Read one idea together, try the fillable workbook and return to review at your own pace. Download the same student worksheet PDF for pencil-and-paper practice.

Fit learning around your family’s day. There is no timer and no sign-up is needed to use the lesson. An optional account saves your lesson position and completion across devices. Workbook responses and drawings stay in this tab; save a copy of your responses before leaving.

Understand your results

Closed answers are checked in your browser. Drawings and written explanations need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.

Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.

For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.

Book page references identify the related teaching topic. File-management and responsible-data preparation are original PaxaKids material; orientation or contents pages are not presented as teaching citations for those skills. The explanations, characters, programs and exercises here are original PaxaKids companion practice. Practical tasks require the appropriate editor and, where applicable, suitable equipment. A design or paper trace is not a verified hardware result. Only completed, reviewed lessons are listed.

Explore the Cambridge Lower Secondary Computing curriculum for programme background. PaxaKids is an independent learning resource.