wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Quiz

Total questions: 65

Worksheet time: 49mins

Name
Class
Date
1.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
2.
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
3.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
4.
What is the name of the programming language we are learning?
a)
Scratch
b)
Python
c)
Pie thin
d)
Scribble
5.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

6.
When you have an error in your code what is the term to summarise finding and fixing that error?
a)
Error checking
b)
Debugging
c)
Syntax finder
d)
Error finder
7.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
8.
What is Python?
a)
text based programming language
b)
word processor 
c)
spreadsheet
d)
block based programming language
9.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
10.
Which statement correctly assigns the string "Tanner" to the variable name?
a)
name  = print( "Tanner")
b)
input("Tanner")
c)
name = "Tanner"
d)
name = input("Tanner")
11.

What is a folder?

a)

the name given to a set of recorded information

b)

the name given to the place where files that can be bought

c)

the name given to the place where files that can be stolen

d)

the name given to the place where files that can be stored

12.

Which of the following types of computer languages uses binary code to communicate with the computer?

a)

High-level languages

b)

Assembly languages

c)

Machine language

d)

Database languages

13.
What is the process of developing and implementing various sets of instructions to enable a computer to do a certain task?
a)
Computer Engineering
b)
Computer Programming
c)
Computer Processing
d)
Computer Science
14.
What is the name of the programming language we are learning?
a)
Scratch
b)
Python
c)
Pie thin
d)
Scribble
15.
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
16.
What is python?
a)
a programming language 
b)
DTP software 
c)
Spreadsheet software
d)
Computer 
17.
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
18.

What are the names of the two types of mode that are used in Python? Select two.

a)

Interactive mode

b)

Scratch mode

c)

Imperial mode

d)

Script mode

19.

What is the name of this symbol (>>>)?

a)

Chevrons

b)

Hash tags

c)

Colon

d)

Semi Colon

20.
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
21.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
22.
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
23.
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.
24.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
25.
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
26.

Python is _____ sensitive which means you must use the same indentation every time.

a)

space

b)

colour

c)

code

d)

word

27.
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
28.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
29.
What is the correct definition for a VARIABLE?
a)
a changeable value, such as a score in a computer game.
b)
a value that cannot be changed
30.

A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly.

a)

True

b)

False

31.
Which part is the inbuilt Python command?
a)
Written in purple
b)
Written in green
c)
The text in brackets
d)
The text in speech marks
32.
Which part is the string?
a)
Written in purple
b)
Written in green
c)
The text in brackets
d)
The text in speech marks
33.
What will this code do?
a)
Miss a line space between two sentences
b)
Miss two lines spaces between a sentence
c)
Miss two lines spaces between two sentences
d)
It will print ""
34.
What does the \n mean?
a)
New line
b)
New word
c)
New file
d)
Nothing - it's a mistake
35.
What's the name of the variable in this code?
a)
School
b)
if
c)
input
d)
print
36.
How many in built Python commands are used in this code?
a)
1
b)
2
c)
3
d)
4
37.
How many strings are there in this code?
a)
4
b)
3
c)
2
d)
1
38.
What question should appear if the code is executed?
a)
You may not get good qualifications
b)
Do you attend school?
c)
Are you paying attention?
d)
Do you understand Python?
39.
If the user answers "No" to the question, "Do you attend school?", what should Python print?
a)
Do you attend school?
b)
print
c)
You may get good qualifications
d)
You may not get good qualifications
40.
How many variables in this code?
a)
0
b)
1
c)
2
d)
3
41.
If someone answered "No" to the question "Do you like school?", what should happen?
a)
print "I'm really pleased!"
b)
print "O, I'm sorry about that"
c)
print "school"
d)
print "no"
42.
If someone answered "Yes" to the question "Do you like school?", what should it print?
a)
print "Something"
b)
Nothing
c)
"I am really pleased"
d)
"I'm really pleased"
43.
What does the colon symbol in Python mean?
a)
if
b)
then
c)
there
d)
their
44.
What is the double equal sign?
a)
A concatenating operator
b)
A conclusive operating
c)
A comparative operator
d)
A smooth operator
45.
What does the double equal sign me?
a)
is equal to
b)
is not equal to
c)
is not equal to or less than
d)
is not less than or equal to
46.
What would happen if the user typed 4 into Python?
a)
print 4
b)
print "You are one short"
c)
print "You have the right amount of fingers"
d)
print "You have too many"
47.
What would happen if the user typed 5 into Python?
a)
print 4
b)
print "You are one short"
c)
print "You have the right amount of fingers"
d)
print "You have too many"
48.
What would happen if the user typed 6 into Python?
a)
print 4
b)
print "You are one short"
c)
print "You have the right amount of fingers"
d)
print "You have too many"
49.
What will the following lines of code print?
a)
A
b)
B
C
c)
A
C
d)
Nothing, it will return an error.
50.
How do you correctly call this function
a)
def(1)
b)
x=square( )
c)
defSquare(4)
d)
x=square(5)
51.
What will print?
a)
nothing
b)
sayHi()
c)
an error message
d)
hi there
52.
What will print?
a)
nothing
b)
5
c)
6
d)
an error message
53.
What will print?
a)
nothing
b)
5
c)
6
d)
an error message
54.
Which of the following best describes the order in which these lines are processed in Python?
a)
4, 1, 2
b)
4, 2, 1
c)
1, 2, 3, 4
d)
3, 1, 2
55.
What will print ?
a)
cats eat mice
b)
mice get away
c)
unknown
d)
error message
56.
Which of the following best describes the order in which these lines are processed in Python?
a)
1,2,3,4
b)
1,2,1,2,1,4
c)
1,2,1,2,1,2,4
d)
1,2,1,2,1,2,1,2,4
57.
What will print?
a)
1
2
11
b)
1
2
21
c)
1
2
3
11
d)
1
2
3
21
58.
What will print?
a)
5
b)
6
c)
3 2
d)
an error message
59.
What will print?
a)
nothing
b)
5
c)
6
d)
an error message
60.
What will print?
a)
nothing
b)
7
c)
z
d)
12
61.
How many times will Boo print?
a)
none
b)
4
c)
5
d)
1
62.
How many times will Boo print?
a)
5
b)
4
c)
none
d)
infinite
63.
What will print?
a)
1 2
b)
1
c)
3
d)
5
64.
What will print?
a)
4
b)
5
c)
nothing
d)
an error message
65.
What will print?
a)
4
b)
5
c)
7
d)
an error message