NEW
Font size
S
M
L
XL
WorksheetsPython Recap
Total questions: 20
Worksheet time: 21mins
Name
Class
Date
1.
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
2.
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
3.
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.
4.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
5.
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!)
6.
What will the output be from the following code?
print(3*4+5)
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
7.
What will the output be from the following code?
print("Hello world!")
print("Hello world!")
a)
SyntaxError
b)
Hello world!
c)
"Hello world!"
d)
print(Hello world!)
8.
In python the ' STRING data type' can be defined as...?
a)
holds alphanumeric text
b)
hold whole numbers
c)
holds numbers with a decimal point
d)
holds either a true or false value
9.
In python the ' FLOAT data type' can be defined as...?
a)
holds alphanumerical data
b)
holds whole numbers
c)
holds a decimal point in a number
d)
hold either true or false
10.
In python the ' BOOLEAN data type' can be defined as...?
a)
holds alphanumerical data
b)
holds whole numbers
c)
holds a number with a decimal point
d)
holds either true or false
11.
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
12.
Mia is writing a program that will store survey she has carried out about smartphones.
What would be a suitable DATA TYPE to use for a variable containing the number of people said they used an Android phone?
What would be a suitable DATA TYPE to use for a variable containing the number of people said they used an Android phone?
a)
A string
b)
An integer
c)
A boolean
d)
A float
13.
How do you add comments to your code?
a)
You can't add comments
b)
By using the hash (#) symbol
c)
By using the asterisk (*) symbol
d)
Using the print command
14.
Which of these is NOT a rule we use to name our variables?
a)
Must begin with a letter or underscore (_)
b)
Variable names must not have any spaces
c)
Choose a consistent naming style
d)
Must begin with a number
15.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
16.
What is the answer to print (12/6)?
a)
1
b)
2
c)
6
d)
10
17.
What will be the output?
name = 'Dave'
print (name)
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
18.
What would print (10 + 16) produce?
a)
20
b)
22
c)
24
d)
26
19.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
20.
What does an IF statement do?
a)
Closes the program
b)
Makes a decision
c)
Asks a question
Reset
