wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python-Quiz#1

Total questions: 8

Worksheet time: 4mins

Name
Class
Date
1.
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.
2.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
3.
Why will the following code not work:
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
4.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
5.
A location in memory used to store data that can be changed.
a)
Constant
b)
Value
c)
Variable
d)
Iteration
6.
Data type that can only be true or false
a)
int
b)
string
c)
bool
d)
float
7.
The following variable contains some data. What is the data type that is being stored.
hobby = "football" 
a)
Integer
b)
Float
c)
String (Text)
8.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError