NEW
Font size
S
M
L
XL
WorksheetsPython Quiz 1
Total questions: 18
Worksheet time: 16mins
Name
Class
Date
1.
What is python named after
a)
The snake
b)
Television show called Monty Python
2.
What is the name of the Windows environment in Python that lets you write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI
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 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!)
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.
Why will the following code not work:
print("Welcome to my program)
print("Welcome to my program)
a)
There is a quotation mark missing
b)
print should be in uppercase
c)
There should not be any brackets
d)
print is spelt incorrectly
7.
What will be the output?
name = 'Dave'
print (name)
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
8.
A location in memory used to store data that can be changed.
a)
Constant
b)
Value
c)
Variable
d)
Iteration
9.
Data type that can only be true or false
a)
int
b)
string
c)
bool
d)
float
10.
The following variable contains some data. What is the data type that is being stored.
hobby = "football"
hobby = "football"
a)
Integer
b)
Float
c)
String (Text)
11.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
12.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus +
c)
forward slash /
d)
asterisk *
13.
What will the output be from the following code?
print("3+4")
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
14.
What will the output be from the following code?
print("3*4+5")
print("3*4+5")
a)
SyntaxErrror
b)
17
c)
3*4+5
d)
12
15.
The second part of if, that is executed when the condition is false
a)
if
b)
else
c)
for
d)
input
16.
What will the following lines of code print?
a)
A
b)
B C
c)
A B C
d)
Nothing, it will return an error.
17.
Which statement will check to see if a is equal to b?
a)
if a == b
b)
if a = b:
c)
if a != b:
d)
if a == b:
18.
a)
5
4
3
2
1
4
3
2
1
b)
4
3
2
1
0
3
2
1
0
c)
5 4 3 2 1
d)
4 3 2 1 0
Reset
