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 stepPython patternPurpose
Input parallelogrampacks = int(input("Packs: "))receive and convert whole-number text
Process rectangletotal = packs * 5calculate and assign a result
Output parallelogramprint(total)display the result
Flow arrownext line in the sequencepreserve 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

Equipment total flowchartStartInput traysInput itemstotal = trays × itemsOutput totalEnd

Read from start to end. Create one Python statement for each input, process and output symbol, in arrow order.

Worked example
trays = int(input("Trays: "))
items = int(input("Items per tray: "))
total = trays * items
print(total)

Check equivalence

Use four questions:

  1. Are both inputs collected?
  2. Are they converted to a type suitable for multiplication?
  3. Is the same calculation assigned to total?
  4. Is total output 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.

Fill in the blanks3 marks
The two input parallelograms map to two label 1 calls. The process rectangle maps to an label 2 statement. The output parallelogram maps to label 3.
  • assignment
  • input()
  • print()
  • selection
  • while

3. A reliable translation method

Annotate before writing code:

  1. write the required variable beside each input symbol;
  2. choose conversion from the kind of data;
  3. copy the process expression accurately, changing flowchart multiplication × to Python *;
  4. place output after processing;
  5. test with values for which you know the expected result.

Do not begin by guessing Python lines. The annotated flowchart is the plan.

Fill in the blanks3 marks
Complete the translation. boxes = label 1(input("Boxes: ")) total = boxes label 2 8 label 3(total)
  • *
  • +
  • float
  • int
  • print
Multiple choice1 mark

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.

Written answer3 marks

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.

Coding task5 marks

5. Use test evidence

A test record should connect input to expected and actual output:

InputsExpectedWhy useful
5, 735ordinary positive values
3, 927different 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.

Written answer3 marks

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.

Multiple choice1 mark

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.