Progress saved automatically

Exam Technique Reference

Before You Code: Three Core Patterns Examiners Test

Every Skill 1 freehand coding question combines these foundational Python patterns. Keep them in mind before attempting Questions 1A through 1D:

Pattern 1 Numeric Input & Casting

input() always returns text (str). Cast whole numbers with int(input()) and decimal values with float(input()).

Pattern 2 Modulo & Branch Order

v % n == 0 tests whether v is divisible by n. Always test the strictest threshold first so general branches do not prematurely consume input.

Pattern 3 Accumulator Loop Sequence

Initialise total to 0 before the loop, repeat the exact count, run a single input() inside the loop to add, and print() after.

Practice Question 1A · 3 Marks

Modulo & Selection Completion

Python 0 / 3 marks

A theme park gives out prizes to every visitor entering through the turnstile, numbered v from 1 to 30:

  • Every 3rd visitor gets a "FastPass"
  • Every 10th visitor gets a "Free meal"
  • Visitors who are both a multiple of 3 and 10 (i.e. 30) get a "VIP upgrade" instead
  • Everyone else gets "Standard entry"

State the Python code that should replace labels L1, L2, and L3 below.

turnstile_prizes.py 11 lines
1v = 1
2while v <= 30:
3 if v % 30 == 0:
4 print("VIP upgrade")
5 elif [ L1 ]:
6 print("Free meal")
7 elif v % 3 == 0:
8 [ L2 ]
9 else:
10 [ L3 ]
11 v = v + 1

Complete Code for Blanks

3 marks

Condition only (omit elif / colon)

Output for every 3rd visitor

Output for all other visitors

Practice Question 1B · 4 Marks

Sequential Input–Process–Output

Python 0 / 4 marks

A school stationery shop sells three items:

  • Pencils cost £0.50 each
  • Notebooks cost £2 each
  • Calculators cost £8.50 each

Write a Python program to calculate the total takings for the day. Your program must:

  • get the user to enter the number of pencils sold, notebooks sold, and calculators sold, storing each in a variable
  • calculate the total money taken
  • output the total money taken.

Your Python Program

4 marks

Write all three inputs, the calculation, and the output (Tab inserts 4 spaces).

Practice Question 1C · 8 Marks

Multi-Branch Selection & Boundary Ordering

Python 0 / 8 marks

Write a Python program that calculates the delivery cost for an online parcel order based on its weight in kilograms (kg).

The cost is calculated as follows:

  • A standard handling fee of £5 plus:
    • £4 per kg if the parcel weighs 10 kg or less
    • £2 per kg if the parcel weighs more than 10 kg
  • If the parcel weighs more than 20 kg, a flat heavy-freight fee of £60 is charged and no other charges apply.

Your program should get the user to enter the weight of the parcel and output the total delivery cost.

Your Python Program

8 marks

Use if, elif, and else. Think carefully about which condition is evaluated first.

Practice Question 1D · 5 Marks

Refactoring into an Iteration Loop

Python 0 / 5 marks

The program below gets four daily rainfall readings (in mm) and outputs the total rainfall.

Rewrite the program so that it achieves the exact same result using an iteration structure that contains only one input() statement.

original_sequential_rainfall.py Original Code
1day1 = int(input())
2day2 = int(input())
3day3 = int(input())
4day4 = int(input())
5totalRain = day1 + day2 + day3 + day4
6print(totalRain)

Refactored Iteration Solution

5 marks

Must contain exactly one input() call inside a loop repeating 4 times.