Font size
WorksheetsPython Online Assessment Year 8 Computing
Total questions: 50
Worksheet time: 25mins
Which of the following is an arithmetic operator in Python?
and
+
or
not
What is the result of 10 % 3 in Python?
3
10
1
0
Which operator is used for exponentiation in Python?
^
**
//
/
What is the result of 10 // 4 in Python?
2.5
3
2
4
Which of the following is a comparison operator?
=
==
&
+
What does the not operator do?
Performs addition
Negates a Boolean value
Compares two values
Divides numbers
Which of the following is a bitwise operator?
//
&
What is the result of True or False?
True
False
None
Error
Which operator is used to check membership or inclusion in Python?
in
is
==
!=
What is the output of 5 > 3 and 2 < 4?
True
False
None
Error
What does the sequence programming construct imply?
Code executes in parallel
Code executes in order
Code skips steps
Code loops indefinitely
Which of the following is an example of a sequence in Python?
if-else
for loop
print("Hello")
while loop
What is the main purpose of a sequence?
To repeat code
To execute code in the correct order
To branch code
To terminate code
Which of the following statements is executed first in a Python program?
The statement with the smallest line number
The last statement in the file
Any random statement
The statement with a function definition
A sequence construct ensures:
Syntax errors are ignored
Logical errors are corrected automatically
Statements execute one after the other
Only loops are used
What is a variable in Python?
A keyword
A storage/memory location with a name to store temporary data
A type of operator
A function
What is the purpose of a function?
To store data
To execute a block of code
To compare values
To repeat tasks
What does IDE stand for?
Integrated Development Environment
Internal Debugging Editor
Intelligent Design Emulator
Integrated Design Editor
What is the data type of the value 42 in Python?
float
int
str
bool
What is the data type of the value True?
Which of the following represents a float in Python?
7
3.14
"3.14"
True
What is the output of type("Hello, world!")?
"Hello, world!"
Good Bye, world!
Hey, world!
Hello, world!
Which data type is used to store a sequence of characters in Python?
list
tuple
str
dict
What is the correct data type for a variable storing the number 5.5?
int
float
str
bool
What is the output of type(10 > 5)?
False
false
True
true
What will be the result of len("Python")?
5
6
7
0
What is the purpose of the int() function in Python?
Which of the following is a valid string in Python?
"Hello"
'Hello'
"""Hello"""
All of the above
What is the data type of 10 / 2 in Python?
int
float
bool
str
What does PEMDAS stand for?
Parentheses, Exponents, Multiplication, Division, Addition, Subtraction
Parentheses, Exponents, Multiplication, Division, Subtraction, Addition
Parentheses, Exponentiation, Modulus, Division, Addition, Subtraction
Parentheses, Exponents, Multiplication, Division, Addition, Subtraction, Modulus
Which operation is performed first according to PEMDAS?
Addition
Multiplication
Parentheses
Exponents
If you have the expression 5 + 2 * 3, what is the result?
21
11
16
15
Which of the following expressions is evaluated first according to PEMDAS?
What will be the result of the expression 6 / 2 * 3?
9
3
1
6
What is the result of the expression 2 + 3 * 4 ** 2 (assuming ^ represents exponentiation)?
2 + 48
50
2 + 16
18
Which of the following is true about the division operation in PEMDAS?
Division is always performed after addition.
Division is performed before multiplication.
Division and multiplication are evaluated left to right.
Division is ignored in PEMDAS.
What will be the result of 10 - 4 + 2?
6
8
4
12
Which operation has the highest precedence in PEMDAS?
Subtraction
Exponentiation
What is the result of the expression 2 + (3 + 5) * 4?
A) 2 + 32
B) 2 + 32 = 34
C) 2 + 40
D) 32
Which operation does not exist in PEMDAS but may be used in programming languages?
A) Modulus
B) Division
C) Parentheses
D) Addition
What is the result of the expression 8 + 4 / 2 * 3?
A) 14
B) 20
C) 18
D) 12
What is the correct evaluation order for 10 + 3 * 5 - 2?
A) Addition, Subtraction, Multiplication
B) Multiplication, Addition, Subtraction
C) Subtraction, Addition, Multiplication
D) Parentheses, Multiplication, Addition
Which of the following will evaluate to 20 in the expression 8 + 2 * 3 ** 2?
A) 8 + 9
B) 8 + 12
What is the result of the expression (3 + 2) * (4 - 1)?
15
7
12
9
How does the order of operations in PEMDAS affect expressions with both division and multiplication?
Multiplication is always performed before division.
Division is always performed before multiplication.
Division and multiplication are performed left to right.
Division and multiplication are performed right to left.
What is the result of 10 * (2 + 3) / 5?
5
10
2
20
Which of the following will be evaluated first in the expression 3 + 4 * 2 - 1?
4 * 2
3 + 4
2 - 1
4 * 3
What will be the result of the expression 3 * (2 + 4) ** 2?
3 * 36
3 * 12
3 * 8
If you have the expression 5 + 3 * 2 - (1 + 1), what is the result?
8
9
10
5
What is Programming or Coding?
Writing algorithms to solve a problem on paper.
Finding the best solution to a problem.
Specify the best way to solve a problem.
Writing precise step-by-step instructions to solve a problem using a programming language.
