Lesson T2.1.2

T2.1.2 Textual programming languages Quiz: KS3 Computing, Unit 2

20 questions

In partnership with Revision Ninja

Lesson T2.1.2, Textual programming languages: 20 multiple choice questions for the KS3 Computing (National Curriculum), Unit 2: Programming, written with Revision Ninja.

Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.

Host this setFree Play

The 20 questions

  1. What is a syntax error?

    • A problem caused by a power cut to the computer
    • A mistake in the rules for writing code, which stops it from running
    • A design choice that makes a program slower than expected
    • A correct line of code that gives the wrong answer
  2. What does the Python line print('Hello') do?

    • Saves the word Hello to a file on the disk
    • Changes the colour of the screen to blue
    • Displays the word Hello on the screen
    • Deletes the word Hello from memory
  3. In Python, x = 5 and then x = x + 2. What is the value of x?

    • 2
    • 5
    • 10
    • 7
  4. Which symbol is used to assign a value to a variable in Python?

    • ==
    • =
    • ==>
    • ::
  5. What is a variable in a text-based program?

    • A named place in memory that holds a value that can change
    • A symbol that starts a comment
    • A value that can never change while the program runs
    • A type of loop that repeats forever
  6. Which Python loop repeats a block of code 3 times?

    • for i in range(3):
    • loop 3 => start:
    • while 3 is true then stop:
    • repeat until three happens:
  7. What does the keyword 'if' do in Python?

    • Stores a number in a variable
    • Repeats the code forever without stopping
    • Prints the code on the screen
    • Runs a block of code only when a condition is true
  8. A Python program has an indentation error. Why does this matter?

    • Indentation is ignored by Python entirely, so spacing never affects a program
    • Python uses indentation to show which lines belong to a block
    • Indentation only changes the colour of the text shown in the editor
    • Indentation makes the program use more memory each time it runs
  9. What is the output of print(2 + 3 * 2) in Python?

    • 8
    • 10
    • 7
    • 12
  10. Which line stores the text 'Maths' in a variable called subject?

    • subject == 'Maths' stored
    • store subject as Maths now
    • 'Maths' = subject
    • subject = 'Maths'
  11. What is a comment in Python code?

    • A loop that counts down from ten and then stops when it reaches zero
    • A variable that holds a list of values that the program can change
    • Text that the computer ignores, written to explain the code
    • A command that makes the program run faster by skipping some steps
  12. A pupil writes print('Hi' in Python. What kind of error is this?

    • A runtime error, because the program runs for too long
    • A logic error, because the output is the wrong colour
    • No error, because the program will run correctly
    • A syntax error, because the closing bracket is missing
  13. What does the statement 'x = x + 1' do in a loop?

    • Deletes the variable x from memory
    • Sets x to one and never changes it again
    • Compares x with one and stops the loop
    • Increases the value of x by one each time it runs
  14. In Python, which word starts a function definition?

    • make
    • def
    • function
    • proc
  15. Which data type is used in Python to store text?

    • Float
    • Integer
    • String
    • Boolean
  16. What is the output of print(len('quiz')) in Python?

    • 1
    • 3
    • 4
    • 5
  17. Why do programmers use meaningful variable names?

    • So the code uses less storage on the disk when it is saved
    • So the code is easier for people to read and understand
    • So the computer runs the code more quickly by shortening its steps
    • So the program can connect to the internet and fetch new data
  18. A pupil writes a program that does not run and shows a message about an unexpected character. What should they check first?

    • The spelling and punctuation of the line the message points to
    • The colour of the window the program appears in while it is running
    • The date on which the program was first written and last saved
    • The size of the monitor the program is shown on, in centimetres
  19. What does a Boolean value in Python hold?

    • A picture of a traffic light
    • Any number between one and ten
    • Either True or False
    • A list of letters from the alphabet
  20. What does the Python input() function do?

    • Deletes a file from the computer's disk
    • Asks the user to type something and returns it as text
    • Stops the program immediately without any output
    • Prints a list of all the variables in memory

All KS3 Computing quizzes