← Exam practice

Placement — Computer Science paper 1 (Python)

2026-09-27 · marked · sat 50 of 120 min · handed in early

Whole paper

19 / 52

Computer Science

19 / 52

Computer Science 52 marks

11 / 1

State what is meant by the term algorithm.

algorithm means a set of instrusions the things will follow
1 min on this question
Got it: instructions that are followed. In the exam add what they are for — a task or a problem — to make it watertight.
20 / 1

State what is meant by decomposition in computational thinking.

taking the code apart
1 min on this question
Decomposition is about a problem, not code. Think: what do you do to a big problem to make it easier to start?
30 / 1

State what is meant by abstraction in computational thinking.

a different way of using code
1 min on this question
Abstraction is about detail: which detail do you keep and which do you leave out when you describe a problem?
40 / 3

State the most appropriate data type for each of the following values in a program.

  1. The number of pupils in a class.
  2. The average height of the pupils, in metres.
  3. Whether or not a pupil has paid for the trip.
1. list 2. list 3. probibilty
q
2 min on this question
The five data types have names (whole numbers, decimals, text, true/false, a single character). Which of those fits each value?
52 / 2

State the value of each expression in Python 3.

  1. 17 // 5
  2. 17 % 5
1. 3 2. 2
1 min on this question
Both right — integer division and remainder, cold, after last week's teaching. Keep it.
62 / 2

State the output of each Python 3 statement.

  1. print("4" + "5")
  2. print(int("4") + int("5"))
1. the outcome is 45 2. the outcome is 9
1 min on this question
Both right — text joins, int() adds. The exact thing you got wrong last week, now correct without notes.
70 / 2

State the output of this Python 3 program.

for i in range(2, 9, 3):
    print(i)
2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4
1 min on this question
range has three numbers here: start, stop, step. The third one is the jump between values. Trace it one value at a time.
80 / 3

A program contains the variables x = 7 and y = 3.

State whether each condition is True or False.

  1. x > 5 and y > 5
  2. not (x == y)
  3. x < 10 or y < 1
1. x is true and y is false 2. false 3. x is true and y is false
2 min on this question
You checked each half — good start — but the question wants one final True or False. What does and need from both halves? What does or need? What does not do to an answer?
92 / 3

A cinema charges for tickets by age:

  • under 5: free
  • 5 to 15 inclusive: £3
  • 16 and over: £5

The variable age already holds a whole number.

Write a Python 3 program that uses age to store the correct price in a variable called price.

age = int(input()) if age < 5: print("Free") elif age < 16: print("£3") else: print("£5")
6 min on this question
Your bands and boundaries are all right — that's the hard part. Read the task again: it asked you to STORE the price in a variable called price, not display it, and age was already set.
103 / 3

Write a Python 3 program that keeps asking the user to enter a password until they enter open. When they do, the program should display Welcome.

password = input() while password != open print("Please try agian") password = input() print("Welcome")
4 min on this question
Full marks on the logic — loop, input inside, Welcome after. One thing to fix in your habits: the word you're comparing against is text, and text needs quote marks. And the colon.
112 / 4

Complete a trace table for this Python 3 program. Type one row for each time a value changes, with the columns a and b, and then state the output.

a = 5
b = 2
while a > 0:
    a = a - b
    b = b + 1
print(a)
a = 3 b = 3 a = 0 b = 4 -1
a = 3 b = 3 a = 0 b = 4
2 min on this question
Your two loop rows were exactly right. Two things: a trace table starts with the values BEFORE the loop, and it stops the moment the while condition is false — check a > 0 before doing another pass.
120 / 3

A program contains this array (list):

scores = [12, 7, 9, 15]
  1. State the value of scores[2].
  2. Write one statement that changes the value 7 to 8.
  3. Write one statement that displays how many items are in the array.
1. 7 2.i don't know 3. count items in scores
3 min on this question
Lists count from 0, not 1 — so the first item is position 0. You'll be taught how to change one item and how to ask a list how long it is; not yet covered, so nothing to worry about.
130 / 2

A program contains this two-dimensional array:

grid = [[1, 2, 3], [4, 5, 6]]
  1. State the value of grid[1][0].
  2. State the value of grid[0][2].
1. 1 2. 5
1 min on this question
A 2-D list is a list of lists: the first number picks the row, the second picks the item in that row, both counting from 0. Not taught yet.
140 / 3

A program contains:

name = "Paddington"
first = "Paige"
last = "Mann"
  1. State the value of len(name).
  2. State the value of name[0:3].
  3. Write an expression that joins first and last with a single space between them.
1. paddington 2. paddington 3. print("{first} {last}")
1. paddington 2. paddington 3. print("{first} {last}")
2 min on this question
len() gives a number (how many characters), and [0:3] picks out a piece of the text. Not taught yet — it's coming.
152 / 2

In Python 3, ord("A") returns 65.

  1. State the value of ord("D").
  2. State the value of chr(67).
1. 68 2. C
2 min on this question
Both right — you reasoned from A = 65 without being told how. Nice.
160 / 1

Write one line of Python 3 that stores a random whole number from 1 to 6 (inclusive) in a variable called dice. You may assume import random has already been done.

dice = while i in range (1, 7)
1 min on this question
This wanted a function from the random module, not a loop. Not taught yet.
170 / 4
  1. Write a Python 3 subroutine (function) called area that takes two parameters, width and height, and returns the area of a rectangle.
  2. Write one line that calls area with the values 4 and 5 and stores the result in a variable called a.
width = int(input()) height = int(input()) a = width*height
width = int(input()) height = int(input()) a = width*height
2 min on this question
The multiplication is right, but a subroutine is a named block you define once and call later with values — a different shape of code you haven't been taught yet.
180 / 3

A program accepts a pupil's age, which must be a whole number from 11 to 18 inclusive.

Give one item of test data for each type below, and state what the program should do with it.

  1. Normal
  2. Boundary
  3. Erroneous
1. 15 2. 18 3. 10
3 min on this question
All three of your values are in the right class — that's the knowledge. The question also asked what the program SHOULD DO with each one (accept it / reject it), and each mark needed both halves. Read the whole question.
192 / 2

This program should display the average of four test scores.

total = 45 + 62 + 58 + 71
average = total / 3
prnt(average)

The program contains one syntax error and one logic error.

  1. State the line that contains the syntax error and what is wrong with it.
  2. State the line that contains the logic error and what is wrong with it.
1. syntax error is on line 3 because the i is missing in print 2. logic error is on line 2 and it is the 3 because it should be a 4
3 min on this question
Both right, with the line number and the reason — exactly how the exam wants it.
200 / 2

A binary search is used to find the value 27 in this list:

3, 8, 12, 15, 21, 27, 30

  1. State the values that are compared, in the order they are checked, until 27 is found.
  2. State one reason a binary search could not be used if the list were not sorted.
1. 3 == 27 = false, 8 == 27 = false, 12 == 27 = false, 21 == 27 = false, 27 == 27 = true
3 min on this question
You checked the items one by one from the start — that's a linear search. A binary search jumps to the middle first. Part 2 was left empty: always write one sentence.
212 / 3

A bubble sort is used to sort this list into ascending order:

5, 1, 4, 2

  1. Show the list after the first pass.
  2. State how the algorithm knows the list is fully sorted.
1. 1, 4, 2, 5 2. it checks the list and finds it sorted
2 min on this question
First pass perfect. For part 2 be precise: what has to happen in a whole pass for the sort to know it can stop?
221 / 2

Describe the two main stages of a merge sort.

using merge sort splits the list into multipule peaks and puts them together after sorting them
3 min on this question
You've got the two stages in the right order. Say how far the splitting goes, and that the ordering happens during the joining, not before it.

This section on the Computer Science record