NEW
Font size
S
M
L
XL
WorksheetsPython
Total questions: 20
Worksheet time: 10mins
Name
Class
Date
1.
What is a variable?
a)
A box(memory location) where you store values
b)
a type of graphics
c)
Data type
d)
a type of memory
2.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus +
c)
forward slash /
d)
asterisk *
3.
What will be the output?
name = "Dave"
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
4.
When you have an error in your code what is the term to summarise finding and fixing that error?
a)
Error checking
b)
Debugging
c)
Syntax finder
d)
Error finder
5.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
6.
What is Python?
a)
text based programming language
b)
word processor
c)
spreadsheet
d)
block based programming language
7.
Which statement correctly assigns the string "Tanner" to the variable name?
a)
name = print( "Tanner")
b)
input("Tanner")
c)
name = "Tanner"
d)
name = input("Tanner")
8.
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
9.
What does the print function do in python?
a)
It's a variable.
b)
It can input data.
c)
It displays an output
d)
It loops the code.
10.
What is the Python built-in function used to display numbers and text on the screen?
a)print
b)
input
c)
output
d)
command
11.
In the following code, "city" is an example of a what?
a)
List
b)
Loop
c)
Variable
d)
Array
12.
The correct way to write a variable in Python?
a)
my_variable = 10
b)
my variable = 10
c)
my_variable is 10
d)
my_variable: 10
13.
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’
14.
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
15.
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
16.
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
17.
what is correct code for INTEGER in python?
a)
in
b)
ing
c)
int
18.
What is the output from the following code?
print ("hello world")
a)
Hello World
b)
hello world
c)
print hello world
19.
Which of the following is a float?
a)
new_var = 1234
b)
new_var = True
c)
new_var = 1.234
d)
new_var = "True"
20.
The requirements for printing a string in Python are:
a)
( ) , ! and " "
b)
( ) and !
c)
( ) and " "
d)
" " and !
Reset
