NEW
Font size
S
M
L
XL
WorksheetsYear9_Exam Preparation Quiz1
Total questions: 38
Worksheet time: 20mins
Name
Class
Date
1.
What do the # marks do in the program?
a)
It would cause the program to halt until you press the enter key
b)
They are ignored by and used for notes only
2.
Which option would work and correct the coding error in the code shown on the right?
a)
Print("Hello humans, what would you like me to do today?"
b)
Print("Hello humans, what would you like me to do today?")
c)
print("Hello humans, what would you like me to do today?")
d)
print(Hello humans, what would you like me to do today?")
3.
This code would ...
a)
Output a list of numbers from 1 to 10
b)
Output a list of numbers from 1 to 9
4.
This code would ...
a)
Output a list of numbers from 1 to 10
b)
Output a list of numbers from 1 to 9
c)
Output a list of numbers from 0 to 9
d)
Output the number 10 only
5.
This code would output a total of ...
a)
10
b)
55
c)
45
d)
36
6.
What would be the result of running this line of code?
a)
33
b)
Supercalifragilisticexpialidocious would be output to the screen
c)
34
d)
35
7.
A student has typed in the code shown which has resulted in an error. Which of the options would fix the error?
a)
line 1 mark=input(what was your exam mark?)
b)
line 2
if mark >= 50:
if mark >= 50:
c)
line 1
mark=int(input(what was your exam mark?))
mark=int(input(what was your exam mark?))
d)
none of these
8.
Which of the following code words would open the door to the secret room?
a)
tumble
b)
text
c)
take
d)
tether
9.
What will be the result of inputting 12 into this program when it is run?
a)
24
'byee'
'byee'
b)
12
c)
byee
d)
24
10.
Why is 'int' needed in line 4?
a)
because age is a variable
b)
because the variable age is storing a number less than 100
c)
because age is a variable that is being used to store a number
11.
What would lines 6 and 7 do in the code shown?
a)
Output the letter 'c'
b)
repeat the letter 'c' across the screen
c)
output the word 'repeat' letter by letter vertically down the screen
d)
output the word 'repeat' 6 times across the screen
12.
What would lines 4 and 5 do in this code?
a)
Output the word 'echo' three times across the screen
b)
Output the word 'echo' three times down the screen.
c)
none of the options as there is a bug in the code.
13.
What would this code do if it is 'run'
a)
Output 'credit'
b)
Output 'fail'
c)
Output 'pass'
14.
What answer would this code output?
a)
55
b)
45
c)
36
d)
0
15.
If this code was used in a repeat structure ...
total=0
for i in range(1,11):
total=total+i
print(total)
Which would be the correct result ...
total=0
for i in range(1,11):
total=total+i
print(total)
Which would be the correct result ...
a)
Count total of numbers from 2 to 9
b)
Count total of numbers from 1 to 10
c)
Count total of numbers from 1 to 11
d)
Count from 2 to 10
16.
What is the colon used for at the end of line 4?
a)
To force the next line of code to be indented
b)
To make line 5 repeat a number of times
17.
A student is experimenting with the 'len' function in the Python language. What would the code shown output if her name was 'Charlotte'?
a)
'hello Charlotte'
b)
'hello'
c)
an error
d)
9
18.
Which line of code would produce an error?
a)
line 1
b)
line 2
c)
neither line
19.
What would print (10 + 16) produce?
a)
20
b)
22
c)
24
d)
26
20.
What is the answer to print (12/6)?
a)
1
b)
2
c)
6
d)
10
21.
What does the following code do?
name = input("what is your name")
name = input("what is your name")
a)
says hello
b)
asks for the users DOB
c)
Asks for the users name and stores it in a variable
d)
Checks information
22.
102 = 100
Which of the following is used in Python to calculate ten squared?
Use the Cheat Sheet to help you.
a)
10 ** 2
b)
10 * 2
c)
10 % 2
d)
10 ** 10
23.
What will the following lines of code print?
a)
A
b)
B C
c)
A C
d)
Nothing, it will return an error.
24.
If this code was run, what would be the result?
a)
Hello
Hello
Hello
b)
Hello
Hello
Hello
Hello
Hello
c)
What did the 3 headed policeman say?
d)
What did the 3 headed policeman say?
Hello
Hello
Hello
Hello
Hello
Hello
25.
Which piece in the coding language Scratch is an input piece?
Hint: It creates a temporary variable
Hint: It creates a temporary variable
a)
Motion pieces
b)
Sensing
c)
Control
d)
Looks
26.
The following code would
a)
set the variable "a" to whatever is stored in "answer"
b)
add whatever is stored in "answer" to the variable "a"
c)
output the number 7
d)
repeat forever
27.
This student has found out how to make new coding pieces. She has made a new piece called 'spin'. What will happen if the coding piece called spin is clicked or the space bar pressed?
a)
Nothing
b)
A sprite will move forward 15 steps
c)
The sprite will rotate clockwise 15 degrees
d)
The sprite will keep spinning forever
28.
What is it called when you join together a set of blocks in Scratch?
a)
List
b)
Program
c)
Sprite
d)
Script
29.
Look at this short snippet of code ...
binarynumber=digit4*8+digit3*4+digit2*2+digit1*1
If you added a variable called digit5, what would you need to muliply it by to convert the binary number 11111 into denary?
binarynumber=digit4*8+digit3*4+digit2*2+digit1*1
If you added a variable called digit5, what would you need to muliply it by to convert the binary number 11111 into denary?
a)
12
b)
16
c)
32
d)
64
30.
What is the denary number equivalent of this binary number 1001
a)
7
b)
9
c)
10
d)
11
31.
What is the denary number equivalent of this binary number 0111?
a)
11
b)
7
c)
8
d)
2
32.
What is the denary number equivalent of this binary number 0110?
a)
5
b)
4
c)
3
d)
6
33.
What is the binary equivalent of the denary number 5?
a)
0101
b)
0111
c)
0100
d)
1111
34.
What is the binary equivalent of the denary number 16?
a)
0100
b)
01000
c)
10000
d)
00001
35.
What is the binary equivalent of the denary number 25?
a)
11001
b)
11111
c)
10001
d)
None of these
36.
This coding piece would ...
a)
add 2 numbers and output the answer
b)
add two numbers together that are stored in varaiables NUM1 and NUM2 and store the answer in variable a
c)
say "hello"
d)
add NUM1 and NUM2 together and output the result
37.
What is this piece used for?
a)
A decision
b)
A process
c)
A start or stop?
d)
A repeat
38.
A student has just learnt how to use the input command in the Python coding language. Which of the following would ask for your name and then output it to the screen?
a)
name=input (What is your name?)
print(name)
print(name)
b)
Input("What is your name?")
print(name)
print(name)
c)
name=input("What is your name")
print(name)
print(name)
d)
input("What is your name?")
print(name)
print(name)
Reset
