Streams of structured data
A sequence of structured records that arrives or is read one at a time, such as sensor readings, file lines or API results, and is processed as it flows.
Understanding Streams of structured data in QCE Digital Solutions Unit 2
What it does: The loop body runs once per record. This shows the one-record-at-a-time idea of a stream. Each API result is a structured record. Looping over them handles them one by one, like any other stream. Sensor readings are a classic stream: each reading arrives in order and can be processed as it comes in. API results can be read record by record. A single variable holds one value, not a sequence of records. Processing as the data flows is the key idea of a stream. Structured records share the same fields, so the program knows where to find each value. Because records flow one at a time, processing can begin straight away.
Common mistakes: A for loop header must end with a colon. It should be: for line in file:. range() needs a number, not a list. To read each sensor reading one at a time, loop directly: for r in readings:.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 186–228) and word search (Modules 144–228).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
streamFill in the Blanks
Spot the Error
Student with a class code? Join your class →