wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Assessment 1

Total questions: 40

Worksheet time: 31mins

Name
Class
Date
1.
In the following expression which element is a comparison operator?
if a > b:
           print(a)
a)
a
b)
>
c)
b
d)
if
2.
In Python an ELSE IF statement is represented as what?
a)
elseif
b)
elif
c)
elsif
d)
ifelse
3.
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
4.
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
5.
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
6.
What is the meaning of the following comparison operator?
a == b
a)
Greater than
b)
Less than or equal to
c)
No equal to
d)
Equal to
7.
IF and ELSE are used when a program needs to make a what?
a)
Repeat
b)
Decision
c)
Change
d)
Output
8.
a)
You can buy some chocloate
b)
You are rich!
c)
Get a job!
d)
You almost have enough
Get a job!
9.
a)
You can buy some chocolate
b)
You are rich
c)
You almost have enough
d)
Get a job!
10.
a)
You can buy some chocolate
b)
You are rich!
c)
Get a job!
d)
You almost have enough
11.
a)
You can buy some chocolate
b)
You are rich
c)
Get a job!
d)
You almost have enough
12.
a)
You can buy some chocloate
b)
You are rich
c)
Get a job!
d)
You almost have enough
13.
a)
Get a job!
b)
You can buy some chocolate
c)
You almost have enough
d)
You are rich!
14.
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
15.
Breaking down a programming task into manageable segments is called what?
a)
Destruction
b)
Description
c)
Deconstruction
d)
Declaration
16.
Which of these variable names is incorrect?
number1
num1
number  1
num_1
a)
number1
b)
num1
c)
number 1
d)
num_1
17.
The process of allowing a program to make a decision is called what?
a)
Sorting
b)
Choosing
c)
Selection
d)
Sectioning
18.
In the following expression which element is an operator?
7 * 3 = 21
a)
*
b)
7
c)
=
d)
21
19.
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 
20.
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
21.
In the following expression which element is an operand?
7 * 3 = 21
a)
3
b)
*
c)
21
d)
=
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.
Which answer will correctly use the variable from the following code to say hello?
name = input("What is your name?")
a)
print(Hello name)
b)
print("Hello " + name)
c)
Print("Hello " + name)
d)
print("Hello + name")
25.
Which statement is true?
a)
A variable is something that does not change
b)
A variable is a space in the computers memory where information can be stored
c)
A variable is always a number
d)
A variable is always text
26.
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
27.
The following variable contains some data. What is the data type that is being stored.
time = 30 
a)
Integer
b)
Float
c)
String (Text)
d)
Boolean
28.
The following variable contains some data. What is the data type that is being stored.
answer = True 
a)
Integer
b)
Float
c)
String (Text)
d)
Boolean
29.
Joining elements together to make a string is called what?
a)
Combining
b)
Connecting
c)
Concatenation
d)
Stringing
30.
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
31.
What will the output be from the following code?
print("Hello" + "world!")
a)
Hello world!
b)
Helloworld!
c)
SyntaxError
d)
"Hello" "world!"
32.
What will the output be from the following code?
print(9/3*2+4-5)
a)
19
b)
5.0
c)
0.5
d)
5
33.
What will the output be from the following code?
print(9/3)
a)
3
b)
3.0
c)
9/3
d)
SyntaxError
34.
What will the output be from the following code?
print("3*4+5")
a)
SyntaxErrror
b)
17
c)
3*4+5
d)
12
35.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
36.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
37.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
38.
What will the output be from the following code?
Print("Hello world!")
a)
NameError
b)
Hello world!
c)
"Hello world"
d)
Print(Hello world!)
39.
What will the output be from the following code?
print("Hello world!")
a)
SyntaxError
b)
Hello world!
c)
"Hello world!"
d)
print(Hello world!)
40.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)