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.
The 20 questions
-
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
-
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
-
In Python, x = 5 and then x = x + 2. What is the value of x?
- 2
- 5
- 10
- 7
-
Which symbol is used to assign a value to a variable in Python?
- ==
- =
- ==>
- ::
-
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
-
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:
-
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
-
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
-
What is the output of print(2 + 3 * 2) in Python?
- 8
- 10
- 7
- 12
-
Which line stores the text 'Maths' in a variable called subject?
- subject == 'Maths' stored
- store subject as Maths now
- 'Maths' = subject
- subject = 'Maths'
-
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
-
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
-
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
-
In Python, which word starts a function definition?
- make
- def
- function
- proc
-
Which data type is used in Python to store text?
- Float
- Integer
- String
- Boolean
-
What is the output of print(len('quiz')) in Python?
- 1
- 3
- 4
- 5
-
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
-
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
-
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
-
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
Related quizzes
- Solving problems with two or more programming languages Quiz · T2.1.1 · 20 questions
- Lists, tables and arrays Quiz · T2.2.1 · 20 questions
- Procedures and functions Quiz · T2.3.1 · 20 questions
- Designing and developing modular programs Quiz · T2.3.2 · 20 questions
- Computational abstractions of real-world systems Quiz · T1.1.1 · 20 questions
- AND, OR and NOT Quiz · T3.1.1 · 20 questions
- Hardware and software components Quiz · T4.1.1 · 20 questions
- Combining applications across devices Quiz · T5.1.1 · 20 questions
- Using technology safely, respectfully and responsibly Quiz · T6.1.1 · 20 questions
- Sorting algorithms Quiz · T1.2.1 · 20 questions