Quick-Fire Assessment

Fundamental Logic Bank

High-speed algorithmic revision. Master the core syntax required for Section B marks.

1

The Missing Input (1 Mark)

A program asks for a PIN code. Complete the code to store the user's input in the variable pin.

Examiner's Notes

  • Using the input() function correctly with standard variable assignment.
2

Fixing the Math (2 Marks)

This code crashes because input() returns a string. Cast it to an Integer so the math works.

3

Joining Strings (1 Mark)

Join the two strings together and print the result: "HelloEveryone".

4

Shopping Math (1 Mark)

Calculate the total price for 5 items at 10 each.

5

Pass or Fail (2 Marks)

Check the score. If it's 50 or more, print "Pass". Else print "Fail".

6

Status Update (1 Mark)

Set the variable `is_active` to True.

7

Pick a Color (1 Mark)

Print the 3rd item in the list ("Green"). Remember Index starts at 0!

8

Trace Code (1 Mark)

What is the final value of `x`? Print it.

9

Logic Error (1 Mark)

The user should pass if they are 18 OR have a ticket. Fix the mistake.

10

Call Function (1 Mark)

Call the function `double` with the number 5 and print the result.

11

Float Times (1 Mark)

Multiply 5 by 2.5 and print the result.

12

String Slicing (1 Mark)

Print the first two letters of "Python" (Result: "Py").

13

Countdown (1 Mark)

Complete the range to print 3, 2, 1.

14

Add to List (1 Mark)

Add "Purple" to the end of the colors list.

15

Traffic Lights (2 Marks)

If light is "Green", print "Go". Else print "Stop".

16

Modulo Remainder (1 Mark)

Calculate the remainder of 10 / 3 using Modulo.

17

Swap Variables (2 Marks)

Swap the values of a and b using the temporary variable `t`.

18

Syntax Fix (1 Mark)

Fix the syntax error in the If statement.

19

Logic Gates (1 Mark)

What is (True AND False) OR True? Print the result.

20

Return Value (1 Mark)

Make the function return the value of a squared.

21

Update Score

Update the variable `score` to 20.

Length of String

Print the length of the string "Exam".

Subtraction

Subtract 5 from 10 and print.

Repeat String

Print "Go" 3 times.

Replace Item

Change the first item of `nums` to 5.

Not Equal

Print True if 5 is not equal to 10.

Less Than

Print True if 5 is less than 10.

If/Elif

If x > 10 print "Big", elif x > 0 print "Medium".

Explicit Logic

Set `ticket = True`. Print "Valid" if `age >= 18` or `ticket`.

Int + Float

Add 2 and 3.0 and print.

Floor Division

Calculate 10 // 3 and print.

Exponents

Calculate 2 to the power of 3 and print.

Membership Check

Print "Found" if "A" is in `grades`.

Not In Check

Print "Safe" if "Virus" is NOT in `files`.

Two Arguments

Complete the function to add two numbers `a` and `b`.

Mixed Types

Print "Score: " joined with `points` (cast points to string!).

Pop Item

Remove the last item from `items` and print the list.

Range Loop

Print numbers from 1 to 3.

Accumulator

Print the sum of 1 and 2 using the `total` variable.

Name Error

Fix the variable name in the print statement.

Level 1 Mastery!

You've secured the foundational method marks. Ready to handle logic branching and data structures?

Enter Level 2