Community resourceWorksheet
1CP2-CT-1.6 From sequence flowchart to Python
Part 6 of 7 · 1CP2-CT-1 · Programming foundations
The translation worksheet, connecting the flowchart notation to the Python written beside it.
Students will:
- map each flowchart symbol to the behaviour it stands for in code
- follow a reliable method for translating a design to Python
- explain why the order of two statements cannot be swapped
- write and test a translation of a supplied flowchart
- choose test data that gives stronger evidence than a single run
Inside: 9 explanation cells, 2 multiple-choice questions, 2 Python tasks, 2 fill-in-the-blanks cells and 2 written answers. 19 marks, about 45 minutes.
Series: 1CP2-CT-1 · Programming foundations, part 6 of 7.
Shared by Coding PathwayVerified teacher
- 17 cells
- About 45 minutes
- CC BY-SA 4.0
- Shared 17 Aug 2026
Preview
The whole resource, exactly as a class sees it. Answers and marking are held back.
From sequence flowchart to Python
A flowchart and a Python program can represent the same algorithm. Translation is successful when the input, processing, output and order are preserved.
This worksheet reactivates the exact Python needed: input(), int(), assignment, multiplication and print(). No selection or loops are used.
1. Map each symbol to behaviour
| Flowchart step | Python pattern | Purpose |
|---|---|---|
| Input parallelogram | packs = int(input("Packs: ")) | receive and convert whole-number text |
| Process rectangle | total = packs * 5 | calculate and assign a result |
| Output parallelogram | print(total) | display the result |
| Flow arrow | next line in the sequence | preserve execution order |
The start and end terminators mark the boundary of the algorithm. They do not need separate Python statements in this simple program.
2. Complete worked translation
Read from start to end. Create one Python statement for each input, process and output symbol, in arrow order.
trays = int(input("Trays: "))
items = int(input("Items per tray: "))
total = trays * items
print(total)Check equivalence
Use four questions:
- Are both inputs collected?
- Are they converted to a type suitable for multiplication?
- Is the same calculation assigned to
total? - Is
totaloutput only after it is calculated?
With trays 4 and items 6, both representations produce 24. One successful test supports equivalence, but the structural checklist catches missing steps that one lucky value might hide.
- assignment
- input()
- print()
- selection
- while
3. A reliable translation method
Annotate before writing code:
- write the required variable beside each input symbol;
- choose conversion from the kind of data;
- copy the process expression accurately, changing flowchart multiplication
×to Python*; - place output after processing;
- test with values for which you know the expected result.
Do not begin by guessing Python lines. The annotated flowchart is the plan.
boxes = label 1(input("Boxes: "))
total = boxes label 2 8
label 3(total)- *
- +
- float
- int
Why must print(total) appear after total = boxes * 8?
- APython requires every print statement to be last in a file.
- BThe value total must be assigned before the output can use it.
- CMultiplication is only permitted after output.
- DThe flowchart start symbol performs the assignment automatically.
4. Independent translation
A sequence flowchart has these steps:
Start → Input packs → Input cards_per_pack → total = packs × cards_per_pack → Output total → End
Both inputs are whole numbers. Your translation must use the stated variable names, convert both inputs with int(), calculate total with multiplication and output only the total. It will be tested with 5 and 7, then 3 and 9.
Write an informal four-step algorithm that preserves the supplied flowchart's two inputs, processing and output.
Use precise ordinary language. This is the planning step before code, so Python syntax is not required.
Students type their answer here.
Write and test the Python translation
Expected behaviour:
- inputs 5 and 7 produce output 35;
- inputs 3 and 9 produce output 27.
Different prompt wording is acceptable. Do not add selection, loops or extra output because they are not present in the flowchart.
5. Use test evidence
A test record should connect input to expected and actual output:
| Inputs | Expected | Why useful |
|---|---|---|
| 5, 7 | 35 | ordinary positive values |
| 3, 9 | 27 | different values expose a hard-coded 35 |
If both tests pass and the structural checklist is satisfied, there is useful evidence that the translation preserved behaviour. Saying only “it worked” omits the evidence.
Explain why testing the translated program with both 5 and 7, and 3 and 9, is stronger than testing only 5 and 7.
Name a possible incorrect program that the second test would expose and connect it to the observed output.
Students type their answer here.
Which change would make the Python program no longer equivalent to the supplied sequence flowchart?
- AChanging the wording inside an input prompt.
- BUsing spaces around the multiplication operator.
- COutputting total before assigning its calculated value.
- DUsing meaningful variable names stated by the flowchart.
Route forward
You can now annotate a sequence flowchart, translate each step into Python, preserve order and use contrasting tests as evidence. The final worksheet retrieves and integrates the whole programming-foundations series without adding a new construct.