wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Programming

Total questions: 29

Worksheet time: 16mins

Name
Class
Date
1.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
2.
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
3.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
4.
What is the name of the programming language we are learning?
a)
Scratch
b)
Python
c)
Pie thin
d)
Scribble
5.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
6.
What will be the output?
name = 'Dave'
greeting = "Good morning" + name
print (greeting)
a)
Good morning 'Dave'
b)
Good morning Dave
c)
Good morning name
d)
Good morning + Dave
7.
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
8.
Which of these would work as a piece of code?
a)
IF answer == "Yes":
b)
if answer == "Yes"
c)
if answer == "Yes":
d)
if answer = "yes":
9.
If you want more than one option for your code, what do you use (after if)?
a)
elif
b)
else
c)
ifif
10.
How do you display text?
a)
input
b)
output
c)
print
d)
variable 
11.
What is python?
a)
a programming language 
b)
DTP software 
c)
Spreadsheet software
d)
Computer 
12.
In Python an ELSE IF statement is represented as what?
a)
elseif
b)
elif
c)
elsif
d)
ifelse
13.
What is the meaning of the following comparison operator?
a > b
a)
Greater than
b)
Less than
c)
Not equal to
d)
Greater than or equal to
14.
What is the meaning of the following comparison operator?
a >= b
a)
Equal to
b)
Not equal to
c)
Greater than or equal to
d)
Less than or equal to
15.
What is the meaning of the following comparison operator?
a != b
a)
Equal to
b)
Greater than
c)
Not equal to
d)
Less than or equal to
16.
IF and ELSE are used when a program needs to make a what?
a)
Repeat
b)
Decision
c)
Change
d)
Output
17.
a)
You can buy some chocloate
b)
You are rich!
c)
Get a job!
d)
You almost have enough
Get a job!
18.
a)
You can buy some chocolate
b)
You are rich
c)
You almost have enough
d)
Get a job!
19.
a)
3, 1, 6, 7, 2, 4, 5
b)
6, 3, 1, 2, 4, 5, 7
c)
3, 6, 1, 2, 4, 5, 7
d)
3, 6, 2, 5, 1, 4, 7
20.
What is syntax?
a)
Syntax is the word used to describe a variable
b)
Syntax is the rules of the programming language
c)
This is used to read information
d)
It is used to output information 
21.
What will the following code do:
print("What is your name?")
a)
Allow you to type in your name
b)
Display the words 'What is your name?' on the screen
c)
Allow you to enter information
d)
Print your name to the screen
22.
The following code is used to create a variable and store a value. Why will it NOT work?
my number = 36
a)
The variable can't store a number
b)
A variable name cannot have any spaces
c)
There variable name can't be called my number
d)
The equals symbol should be at the beginning of the line
23.
What is the output from the following code:
name = "Fred"
print("Hello " + name)
a)
Hello Fred
b)
Hello name
c)
Name error
d)
HelloFred
24.
The following variable contains some data. What is the data type that is being stored.
hobby = "football" 
a)
Integer
b)
Float
c)
String (Text)
d)
Boolean
25.
What will the output be from the following code?
print("Hello world!" * 2)
a)
TypeError
b)
Hello world world!
c)
Hello world!Hello world!
d)
Hello world! * 2
26.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
27.
What will the output be from the following code?
print("Hello world!")
a)
SyntaxError
b)
Hello world!
c)
"Hello world!"
d)
print(Hello world!)
28.
What will the output be from the following code?
Print("Hello world!")
a)
NameError
b)
Hello world!
c)
"Hello world"
d)
Print(Hello world!)
29.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)