NEW
Font size
S
M
L
XL
WorksheetsPython WJEC KS4
Total questions: 20
Worksheet time: 10mins
Name
Class
Date
1.
print("12"*3)
What would this print?
What would this print?
a)
36
b)
121212
c)
24
d)
12*3
2.
What will the output be from the following code?
Print("Hello world!")
Print("Hello world!")
a)
NameError
b)
Hello world!
c)
"Hello world"
d)
Print(Hello world!)
3.
What will the output be from the following code?
print(Hello world!)
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
4.
What will the output be from the following code?
print("Hello world!\nHello world!")
print("Hello world!\nHello world!")
a)
Hello world! Hello world!
b)
Hello world!
Hello world!
Hello world!
c)
SyntaxError
d)
Hello world!
5.
What will the output be from the following code?
print("Hello world!" * 2)
print("Hello world!" * 2)
a)
TypeError
b)
Hello world world!
c)
Hello world!Hello world!
d)
Hello world! * 2
6.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
7.
Which is the most appropriate data type for: "13th December"
a)
Float
b)
Boolean
c)
Integer
d)
String
8.
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
9.
A location in memory used to store data that can be changed.
a)
Constant
b)
Value
c)
Variable
d)
Iteration
10.
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
11.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus +
c)
forward slash /
d)
asterisk *
12.
What is Python?
a)
text based programming language
b)
word processor
c)
spreadsheet
d)
block based programming language
13.
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
14.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
15.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
16.
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
17.
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
18.
Tells the interpreter that the code which follows is a function
a)
const
b)
int
c)
def
d)
while
19.
Joining elements together to make a string is called what?
a)
Combining
b)
Connecting
c)
Concatenation
d)
Stringing
20.
If you want more than one option for your code, what do you use (after if)?
a)
elif
b)
else
c)
ifif
Reset
