Font size
WorksheetsY8 EOY CS revision - python & algorithms
Total questions: 56
Worksheet time: 28mins
A set of precise instructions that is meant to solve a problem is .......................
a computer
an algorithm
a program
an interpreter
What symbol is used in python to assign values to a variable?
plus +
forward slash /
equals =
asterisk *
Read the Python program:
When this program is executed, what will be displayed on the screen?
Note: There may be errors in the program and/or it may not behave as expected.
"I live in", location
"I live in", "Leeds"
I live in location
I live in Leeds
Read the Python program:
When this program is executed, what will be displayed on the screen, as a result of executing line 3?
Note: There may be errors in the program and/or it may not behave as expected.
I’ve never been to and whatever the user has typed at the keyboard
I’ve never been to location
I’ve never been to input()
It is not possible to know the output without executing the program.
Which feature of programming involves a decision, but does not involve repeats?
Sequence
Selection
Iteration
Read the Python program below:
1. answer = 3 + 13 * 3
2. print("The Answer is", answer)
When this program is executed, what will be displayed on the screen?
Note: There may be errors in the program and/or it may not behave as expected.
The Answer is 3 + 13 * 3
The Answer is 42
The Answer is 48
The Answer is answer
The code you use to receive an input from the keyboard
enter()
receive()
add()
input()
Read the Python program:
When this program is executed, what will be displayed on the screen if the user enters 0 at the prompt?
0 is positive 0 is negative
0 is positive
0 is negative
The program will not display anything because 0 is neither positive nor negative.
What is the word (command) used to display numbers and text on the screen?
output
input
command
A WHILE loop is an example of which type of feature
Sequence
Selection
Iteration
Concatenation
Read the Python program:
When this program is executed, what will be displayed on the screen?
Note: There may be errors in the program and/or it may not behave as expected.
small
medium
medium large
large
To display the following on screen
Hello World!
the following command should be used:
print(Hello World!)
print("Hello World" + !)
print("Hello World!")
print"(Hello World!)"
If you receive a NameError (name is not defined) when you run your program it means....
A variable has been assigned before it has been referred to.
An incorrect name has been chosen.
A variable has been referred to before it has been assigned.
A language key word has been used.
What will be the output?
1. name = "Dave"
2. print (name)
"Dave"
name
(name)
Dave
Read the Python program:
When this program is executed, how many times will line 4 be executed?
Note: There may be errors in the program and/or it may not behave as expected.
Line 4 will be executed once.
Line 4 will be executed at least once.
Line 4 will be executed 1357 times.
Line 4 will be executed an infinite number of times (the while loop will never terminate).
Which line of code would create a variable called
my_message
and give it the value
"bye"?:
my_message = “bye”
“my_message” = bye
variable my_message = “bye”
my_message(“bye”)
What will the output be from the following code?
Print("Hello world!")
Hello world!
"Hello world"
NameError
Print(Hello world!)
Read the Python program:
How many times will line 3 be executed?
Note: There may be errors in the program and/or it may not behave as expected.
None (the condition in line 2 will be False the first time it is checked)
1
3
4
Infinitely (the condition in line 2 will never become False)
Read the Python code:
Which code is missing from line 11 to ''raise the Boolean flag' and end the game?
guessed = True
guessed = False
guessed == True
guessed = "False"
What syntax would you use to create a name variable?
name=input{}
input=name
name=input()
name=INPUT
What is decomposition?
Adding detail to make a problem more complex
When you ignore the unnecessary detail in a problem
Breaking down a complex problem or system into smaller, more manageable parts
Identify the correct definition of abstraction
Creating a flowchart to outline how the system will work
Identify the appropriate variable names to use in a program
Hiding unnecessary data/detail and focusing on the key data/detail
Breaking down a larger problem into smaller sub problems
What is pattern recognition?
Breaking down a complex problem into smaller problems
Building models from patterns
Looking for similarities among and within problems
Identify the pseudocode algorithm that performs the same outputs as this flowchart.
A
B
C
D
Identify which pseudocode algorithm performs the same function as the flowchart:
A
B
C
D
Identify the output from the following algorithm:
5
10
15
20
identify which algorithm will output the numbers 1 to 20
A
B
C
D
When using iteration in an Algorithm what is a condition?
a string
a statement that is either True or False
an integer
a list
What does this code do?
while answerIsWrong == TRUE
print("What is the answer?")
Creates a loop
Takes an input from the user
creates a string
calculates Pi
What does the following code do?
if goodGrades == TRUE then
print("Congratulations!")
end if
updates goodGrades variable
if a condition is met, prints a message to the screen
creates a loop
take an input from the user
Why do we decompose a complex problem?
To make it more difficult to solve
To make it easier to solve
To change the problem we have
Which of these is an example of decomposition?
Watching a mechanic repair a car
Looking at different car model for similarities between them
Finding out how a car works by looking in detail at the different parts that make up the car
Which of these is an example of decomposition?
Breaking down the problem of organising a cake sale into smaller parts, such as who will bake the cakes and when to hold the cake sale
Taking the problem of baking a cake and thinking about how we can make it the best cake possible
Asking people what their favourite cake is
How often do we decompose problems?
We never decompose them, computers do this for us
Every day, often without thinking about it
Occasionally, but we don’t really need to
Which of these is an example of decomposition?
Guessing who has solved a crime from looking at patterns that have happened before
Solving the complex problem of a crime by breaking it down into when the crime was committed and were there any witnesses
Looking at what different crimes could be committed
Why do we need to look for patterns in problems?
We don't need to look for patterns
Patterns make it easier for us to solve complex problems
Patterns make it more difficult for us to solve complex problems
What rule is being used in the pattern below?
2, 4, 6, 8, 10, 12
multiply by 2
add 2
subtract 2
divide by 2
Which pattern comes next?
A
B
C
D
What are the missing numbers in this pattern?
23, 33, ___, 53, ___, 73
32, 62
42, 63
43, 63
42, 62
Which of the following pieces of information are specific detail when drawing a house rather than a general pattern (Select more than one answer)
There are houses in London
A house has windows
A house has walls
Some houses have a garage attached
Some houses have a red front door
When designing a building that must be accessible for wheelchairs, which of the following characteristics is non-essential?
Number of doors
Number of wall paintings
Number of walls
Types of floor coverings
A school database has lots of information on students, the data manager needs to use abstraction, What data should she leave out?
Age
Classes
Guardian's phone number
Eye Colour
Which of the following is NOT computational thinking?
decomposition
coding
pattern recognition
algorithms
What does the oval/circle mean in a flowchart?
Input/Output
Decision
Start/End
For loop
What shape is used for decision in flowcharts
Square
Rhombus
Triangle
Circle
How many arrows should come out of a decision symbol in a flowchart?
0
1
2
3
What would be the output of this flowchart if the student scored 59?
A
B
C
Fail
Identify the output from this algorithm, when the number 5 is entered first and then the number 6.
5
6
11
35
Identify the statement about algorithms that is true.
An algorithm will only run when it has been written correctly.
Only computer programmers write algorithms.
They are a series of steps or instructions.
They are always written on a computer using a programming language.
Identify the correct definition of a flowchart
A diagram that represents a set of instructions, using standard symbols
Identify the appropriate variable names to use in a program
Hiding unnecessary data/detail and focusing on the key data/detail
Breaking down a larger problem into smaller sub problems
Identify the correct definition of an algorithm
Creating a flowchart to outline how the system will work
Identify the appropriate variable names to use in a program
A list of rules to follow in the right order to solve a problem.
Hiding unnecessary data/detail and focusing on the key data/detail
Identify the program that will output the number 10
A
B
C
D
A satellite navigation system is being designed to help drivers find their way to their destination.
Identify which of the following are actions of abstraction to be undertaken?
Identify the description of how decomposition is applied in this system.
Identify the variables to store the current position e.g, longitude, latitude
Ignoring elements such as scenery (e.g. fields, trees)
Splitting the system into subprograms such as user entry, route generation and route display
Which type of iteration should be used when you know how many times you want to loop?
count controlled
condition controlled
The pseudocode INPUT SCORE describes that data inputted into the system should be stored in the variable SCORE.
True
False
Pseudocode is used by the computer to know what an algorithm should do.
True
False
