wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Quiz

Total questions: 15

Worksheet time: 12mins

Name
Class
Date
1.
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
2.
In python the ' INTEGER data type' can be defined as...?
a)
holds alphanumeric data as text
b)
holds whole numbers
c)
holds numbers with a decimal point
d)
holds either ‘true’ or ‘false’
3.
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
4.
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
5.
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
6.
What data type would be used for storing someone's telephone numbers?
a)
Float (using a decimal point)
b)
Integer (just whole numbers)
c)
String (alphanumerical data)
7.
If we needed to store information such as a POSTCODE in PYTHON, what data type would we use?
a)
String (alphanumerical)
b)
Float (decimal point)
c)
Boolean (true or false)
8.
What is the correct definition for 'pseudo code?'
a)
a notation resembling a complex programming language, used in program design.
b)
a notation resembling a simplified programming language, used in program design.
9.
What is the function of the code:amount = int(input("Enter a conversion into pounds:))currency = input ("press 1 for indian rupees, 2 for Chinese yuan or 0 to exit:")
a)
to find the total amount of currency altogether
b)
to calculate and convert the exchange rates.
10.
what is the code for a STRING in python?
a)
str
b)
stri
c)
stg
11.
what is correct code for INTEGER in python?
a)
in
b)
ing
c)
int
12.
What is the output from the following code?print ("hello world")
a)
Hello World
b)
hello world
c)
print hello world
13.
What best defines an IF statement in python?
a)
Is an embedded string with a variable
b)
An IF statement checks to see if a statement is true or false and then does one of two things depending on the result.
14.
I am 71 years old! What will the output be?: IF you are 70 or older, say “You are aged to perfection!” ELIF you are exactly 50, say “Wow, you are half a century old!” ELSE say “You are a spring chicken!”
a)
“You are aged to perfection!”
b)
"Wow, you are half a century old!"
c)
"You are a spring chicken!"
15.
I am 18 years old! What will the output be?: IF you are 70 or older, say “You are aged to perfection!” ELIF you are exactly 50, say “Wow, you are half a century old!” ELSE say “You are a spring chicken!”
a)
"You are aged to perfection"
b)
"Wow, you are half a century old!"
c)
"You are spring chicken!"