wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Term 1 Year 8

Total questions: 100

Worksheet time: 1hrs 18mins

Name
Class
Date
1.
To create a newline at the end of prompt, you can use which of the following expressions?
a)
\new
b)
\n
c)
\break
d)
\return
2.
The number or word we give to a variable
a)
Value
b)
Bug
c)
Information
d)
Text
3.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
4.
What is a variable?
a)
A box(memory location) where you store values
b)
a type of graphics
c)
Data type
d)
a type of memory
5.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
6.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
7.
What is the name of the programming language we are learning?
a)
Scratch
b)
Python
c)
Pie thin
d)
Scribble
8.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
9.
What will be the output?
name = 'Dave'
greeting = "Good morning" + name
print (greeting)
a)
Good moning 'Dave'
b)
Good morning Dave
c)
Good morning name
d)
Good morning + Dave
10.
Why is it called 'Python'?
a)
The guy who created it loves snakes
b)
The guy who created it loves Monty Python films
c)
You can create a game on python called snake
d)
It was created by someone called Mr Python
11.
Python is an example of a....
a)
Text-based programming language
b)
Object orientated programming language
c)
language written in java script
d)
Visual-based programming language
12.
Which of these would work as a piece of code?
a)
IF answer == "Yes":
b)
if answer == "Yes"
c)
if answer == "Yes":
d)
if answer = "yes":
13.
What is the answer to print (12/6)?
a)
1
b)
2
c)
6
d)
10
14.
How do you display text?
a)
input
b)
output
c)
print
d)
variable 
15.
What is python?
a)
a programming language 
b)
DTP software 
c)
Spreadsheet software
d)
Computer 
16.
What is the name of the environment in Python that write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI
17.
What button do you press to compile (run) your program so that it runs in the shell?
a)
F3
b)
F5
c)
F7
d)
F9
18.

people = ["John", "Rob", "Bob"]

print (people[1])

what would this result be?

a)
John
b)
Rob
c)
Bob
19.

people = ["John", "Rob", "Bob"]

print (people[-1])

what would this result be?

a)
John
b)
Rob
c)
Bob
20.

people = ["John", "Rob", "Bob"]

print (people[4])

what would this result be?

a)
John
b)
Rob
c)
Bob
d)
Error
21.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
22.
What will the output be from the following code?
print("Hello world!")
a)
SyntaxError
b)
Hello world!
c)
"Hello world!"
d)
print(Hello world!)
23.
What will the output be from the following code?
Print("Hello world!")
a)
NameError
b)
Hello world!
c)
"Hello world"
d)
Print(Hello world!)
24.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
25.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
26.
What will the output be from the following code?
print(3*4)
a)
34
b)
7
c)
12
d)
3*4
27.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
28.
What will the output be from the following code?
print("3*4+5")
a)
SyntaxErrror
b)
17
c)
3*4+5
d)
12
29.
What will the output be from the following code?
print(9/3)
a)
3
b)
3.0
c)
9/3
d)
SyntaxError
30.
What will the output be from the following code?
print(9/3*2+4-5)
a)
19
b)
5.0
c)
0.5
d)
5
31.
What will the output be from the following code?
print("Hello" + "world!")
a)
Hello world!
b)
Helloworld!
c)
SyntaxError
d)
"Hello" "world!"
32.
What will the output be from the following code?
print("Hello" + "world" + "today")
a)
Helloworldtoday
b)
Hello world today
c)
"Hello" "world" "today"
d)
SyntaxError
33.
What will the output be from the following code?
print("Hello" + str(2) + "world!")
a)
Hello world! Hello world!
b)
Hello2world!
c)
Hello Hello world! world!
d)
SyntaxError
34.
Joining elements together to make a string is called what?
a)
Combining
b)
Connecting
c)
Concatenation
d)
Stringing
35.
Which Python command is used to output information to the screen?
a)
read
b)
output
c)
print
d)
display
36.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information 
37.
What is python named after
a)
The snake
b)
Television show called Monty Python
38.
What is the name of the environment in Python that write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI
39.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
40.
What button do you press to compile (run) your program so that it runs in the shell?
a)
F3
b)
F5
c)
F7
d)
F9
41.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
42.
What does the print function do in python?
a)
It's a variable.
b)
It can input data.
c)
It displays something like a string or integer
d)
It loops the code.
43.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
44.
What syntax can you use to insert a line break between strings so that they appear over multiple lines?
a)
/
b)
\n
c)
\l
d)
n
45.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
46.
Code executed based on a condition being true
a)
Sequence
b)
Selection
c)
Iteration
d)
Variable
47.
Code repeated / looped until a condition has been met or a set number of times.
a)
Sequence
b)
Selection
c)
Iteration
d)
Variable
48.
Count controlled loop - code executed a given number of times
a)
While loop
b)
For loop
c)
Repeat loop
d)
If...else
49.
Count controlled loop - code executed a given number of times
a)
While loop
b)
For loop
c)
Repeat loop
d)
If...else
50.
A loop repeated if the condition is true / false
a)
While loop
b)
For loop
c)
Repeat loop
d)
If...else
51.
Data type for a whole number
a)
String
b)
Integer
c)
Boolean
d)
Float
52.
A location in memory used to store data that can be changed.
a)
Constant
b)
Value
c)
Variable
d)
Iteration
53.
To solve a problem that requires the user to enter 10 numbers would use what type of iteration?
a)
While loop
b)
For loop
c)
Variable
d)
Selection
54.
The user is asked to enter a number which must be below one hundred. What type of iteration would be used to check this?
a)
For loop
b)
While loop
c)
Check loop
d)
Repeat loop
55.
Which of these is spelt correctly...
a)
Iteration
b)
Iteraton
c)
Iteretion
d)
Iterasion
56.
What will the output be from the following code?
print("Hello world!\nHello world!")
a)
Hello world! Hello world!
b)
Hello world!
Hello world!
c)
SyntaxError
d)
Hello world!
57.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information 
58.
Tells the interpreter that the code which follows is a function
a)
const
b)
int
c)
def
d)
while
59.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
60.
What will the output be from the following code?
print("Hello world!" * 2)
a)
TypeError
b)
Hello world world!
c)
Hello world!Hello world!
d)
Hello world! * 2
61.
Look at this code, how many times will it loop?
a)
50
b)
90
c)
0
d)
4
62.
Look at this code, what shape will it make?
a)
Square
b)
Triangle
c)
Rectangle
d)
Hexagon 
63.
Look at this code, what is the variable? 
a)
0
b)
4
c)
for
d)
i
64.
What is wrong with this code?
a)
Missing Brackets
b)
Missing Comma
c)
Missing Colon
d)
Incorrect spelling 
65.
What is wrong with this code?
a)
Missing Brackets
b)
Missing Comma
c)
Missing Colon
d)
Incorrect spelling 
66.
What will be the output from this code?
a)
Square
b)
Triangle
c)
Circle
d)
Rectangle
67.
What will be the output from this code?
a)
Square
b)
Triangle
c)
Circle
d)
Rectangle
68.
What will be the output from this code?
a)
A star with an orange outline
b)
A solid orange star
c)
A pentagon with an orange outline
d)
A solid orange pentagon
69.
What will be the output from this code?
a)
A pentagon with an orange outline
b)
A solid orange star
c)
A star with an orange outline
d)
A solid orange pentagon
70.
What will be the output from this code?
a)
A star with an orange outline
b)
A solid orange star
c)
A pentagon with an orange outline
d)
A solid orange pentagon
71.
This code should draw a solid orange square but it is not correct. How many errors are there?
a)
1
b)
2
c)
3
d)
4
72.
What is the output from this code?
a)
A sequence of four orange triangles
b)
An orange triangle and an orange square
c)
A sequence of three orange squares
d)
Error
73.
This code should draw a square with an orange outline but it is not correct. How many errors are there?
a)
1
b)
2
c)
3
d)
4
74.
In Python, a subroutine, function or procedure is created by using which key word?
a)
sub
b)
fun
c)
def
d)
pro
75.
When creating a def in Python, what is the correct order for the elements?
a)
def ( ) subroutine :
b)
def subroutine : ( )
c)
def subroutine ( ) :
d)
def : ( ) subroutine
76.
To stop the turtle drawing you need to use which of the following commands?
a)
penup:
b)
pen_up( )
c)
penup( )
d)
penup( ):
77.
To move the turtle to  a specific position on the drawing canvas you need to use which of the following commands?
a)
set_pos( )
b)
setpos( ):
c)
setpos
d)
setpos( )
78.
What sort of error has happened if you forget to include : when you need one?
a)
Logical
b)
Forgotten colon
c)
Runtime
d)
Syntax
79.
What does forward(300) do?
a)
Moves in the direction it is facing 300 steps
b)
Moves down the screen 300 steps
c)
Moves up the screen 300 steps
80.
What does turn(90) do?
a)
Turns right 90 degrees
b)
Turns left 90 degrees
c)
Moves forward 90
d)
Does nothing as 'turn' is not a turtle instruction
81.
What is the window called where you write your code?
a)
Editor
b)
Shell
82.
What is wrong with this code?
a)
Missing Brackets
b)
Missing Comma
c)
Missing Colon
d)
Incorrect spelling 
83.
What is a variable? 
a)
A value that can change
b)
A number
c)
A value that can never change
d)
A letter
84.
What output would result from the following expression?
print(2 + 3.0)
a)
5.0
b)
5
c)
"2 + 3.0"
d)
SyntaxError
85.
Which of the following functions is used to get information from the user of a program?
a)
input()
b)
print()
c)
import
d)
eval()
86.
What does the following code do? 
Score = Score + 1 
a)
Nothing 
b)
prints score 
c)
Displays 1
d)
adds 1 onto the score 
87.

Which of the following is the correct way to print hello world in Python?

a)

Print("hello world")

b)

PRINT(hello world)

c)

print(hello world)

d)

print("hello world")

88.

Which of the following is the correct way to create a square?

a)

turtle.forward(100)

turtle.right(90)

turtle.forward(100)

turtle.left(90)

turtle.forward(100)

turtle.right(90)

turtle.forward(100)

turtle.left(90)

b)

turtle.forward(100)

turtle.left(90)

turtle.forward(100)

turtle.left(90)

turtle.forward(100)

turtle.left(90)

turtle.forward(100)

turtle.left(90)

c)

turtle.forward(100)

turtle.left(180)

turtle.forward(100)

turtle.left(180)

turtle.forward(100)

turtle.left(180)

turtle.forward(100)

turtle.left(180)

d)

turtle.forward(100)

turtle.left(90)

turtle.forward(200)

turtle.left(90)

turtle.forward(100)

turtle.left(90)

turtle.forward(200)

turtle.left(90)

89.

What is the operator for multiplication?

a)

*

b)

x

c)

**

90.

What is the correct operator for greater than or equal to?

a)

<

b)

>=

c)

<=

d)

>

91.

Find the line of code with an error:

a)

print("good morning")

b)

colour = input("what colour would you like?")

c)

Print("good morning")

d)

color = input("what colour would you like?")

92.

To change the turtle line colour I would use:

a)

turtle.pencolour("Red")

b)

turtle.pencolour(Red)

c)

turtle.pencolor("Red")

d)

turtle.pencolor(Red)

93.

for counter in range(3):

turtle.forward(100)

turtle.right(180)


This code will draw a...

a)

square

b)

rectangle

c)

circle

d)

triangle

94.

if number == 10:

print("That's high")

elif number >= 5:

print("That's quite high")

else:

print("That's pretty low")


If I enter 9 into this program, what will I get out?

a)

An error

b)

That's quite high

c)

That's pretty low

d)

That's high

95.

if number == 10:

print("That's high")

elif number >= 5:

print("That's quite high")

else:

print("That's pretty low")


If I enter 0 into this program, what will I get out?

a)

An error

b)

That's quite high

c)

That's pretty low

d)

That's high

96.

Which of the following lines of code is correct?

a)

name = input("what is your name?"

b)

name = Input("what is your name?")

c)

name = input("what is your name?")

d)

name = INPUT("what is your name?")

97.
What does the following code do?
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 
98.
How do you add a comment in python 
a)
!
b)
"
c)
/
d)
#
99.
What is python?
a)
a programming language 
b)
DTP software 
c)
Spreadsheet software
d)
Computer 
100.
Which of the following is the correct way to prepare your file to be ready to use Turtle?
a)
import turtle
b)
turtle GetReady
c)
important turtle
d)
import theStuff