wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Online Assessment Year 8 Computing

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

Which of the following is an arithmetic operator in Python?

a)

and

b)

+

c)

or

d)

not

2.

What is the result of 10 % 3 in Python?

a)

3

b)

10

c)

1

d)

0

3.

Which operator is used for exponentiation in Python?

a)

^

b)

**

c)

//

d)

/

4.

What is the result of 10 // 4 in Python?

a)

2.5

b)

3

c)

2

d)

4

5.

Which of the following is a comparison operator?

a)

=

b)

==

c)

&

d)

+

6.

What does the not operator do?

a)

Performs addition

b)

Negates a Boolean value

c)

Compares two values

d)

Divides numbers

7.

Which of the following is a bitwise operator?

a)

//

b)

&

8.

What is the result of True or False?

a)

True

b)

False

c)

None

d)

Error

9.

Which operator is used to check membership or inclusion in Python?

a)

in

b)

is

c)

==

d)

!=

10.

What is the output of 5 > 3 and 2 < 4?

a)

True

b)

False

c)

None

d)

Error

11.

What does the sequence programming construct imply?

a)

Code executes in parallel

b)

Code executes in order

c)

Code skips steps

d)

Code loops indefinitely

12.

Which of the following is an example of a sequence in Python?

a)

if-else

b)

for loop

c)

print("Hello")

d)

while loop

13.

What is the main purpose of a sequence?

a)

To repeat code

b)

To execute code in the correct order

c)

To branch code

d)

To terminate code

14.

Which of the following statements is executed first in a Python program?

a)

The statement with the smallest line number

b)

The last statement in the file

c)

Any random statement

d)

The statement with a function definition

15.

A sequence construct ensures:

a)

Syntax errors are ignored

b)

Logical errors are corrected automatically

c)

Statements execute one after the other

d)

Only loops are used

16.

What is a variable in Python?

a)

A keyword

b)

A storage/memory location with a name to store temporary data

c)

A type of operator

d)

A function

17.

What is the purpose of a function?

a)

To store data

b)

To execute a block of code

c)

To compare values

d)

To repeat tasks

18.

What does IDE stand for?

a)

Integrated Development Environment

b)

Internal Debugging Editor

c)

Intelligent Design Emulator

d)

Integrated Design Editor

19.

What is the data type of the value 42 in Python?

a)

float

b)

int

c)

str

d)

bool

20.

What is the data type of the value True?

4 lines
21.

Which of the following represents a float in Python?

a)

7

b)

3.14

c)

"3.14"

d)

True

22.

What is the output of type("Hello, world!")?

a)

"Hello, world!"

b)

Good Bye, world!

c)

Hey, world!

d)

Hello, world!

23.

Which data type is used to store a sequence of characters in Python?

a)

list

b)

tuple

c)

str

d)

dict

24.

What is the correct data type for a variable storing the number 5.5?

a)

int

b)

float

c)

str

d)

bool

25.

What is the output of type(10 > 5)?

a)

False

b)

false

c)

True

d)

true

26.

What will be the result of len("Python")?

a)

5

b)

6

c)

7

d)

0

27.

What is the purpose of the int() function in Python?

4 lines
28.

Which of the following is a valid string in Python?

a)

"Hello"

b)

'Hello'

c)

"""Hello"""

d)

All of the above

29.

What is the data type of 10 / 2 in Python?

a)

int

b)

float

c)

bool

d)

str

30.

What does PEMDAS stand for?

a)

Parentheses, Exponents, Multiplication, Division, Addition, Subtraction

b)

Parentheses, Exponents, Multiplication, Division, Subtraction, Addition

c)

Parentheses, Exponentiation, Modulus, Division, Addition, Subtraction

d)

Parentheses, Exponents, Multiplication, Division, Addition, Subtraction, Modulus

31.

Which operation is performed first according to PEMDAS?

a)

Addition

b)

Multiplication

c)

Parentheses

d)

Exponents

32.

If you have the expression 5 + 2 * 3, what is the result?

a)

21

b)

11

c)

16

d)

15

33.

Which of the following expressions is evaluated first according to PEMDAS?

4 lines
34.

What will be the result of the expression 6 / 2 * 3?

a)

9

b)

3

c)

1

d)

6

35.

What is the result of the expression 2 + 3 * 4 ** 2 (assuming ^ represents exponentiation)?

a)

2 + 48

b)

50

c)

2 + 16

d)

18

36.

Which of the following is true about the division operation in PEMDAS?

a)

Division is always performed after addition.

b)

Division is performed before multiplication.

c)

Division and multiplication are evaluated left to right.

d)

Division is ignored in PEMDAS.

37.

What will be the result of 10 - 4 + 2?

a)

6

b)

8

c)

4

d)

12

38.

Which operation has the highest precedence in PEMDAS?

a)

Subtraction

b)

Exponentiation

39.

What is the result of the expression 2 + (3 + 5) * 4?

a)

A) 2 + 32

b)

B) 2 + 32 = 34

c)

C) 2 + 40

d)

D) 32

40.

Which operation does not exist in PEMDAS but may be used in programming languages?

a)

A) Modulus

b)

B) Division

c)

C) Parentheses

d)

D) Addition

41.

What is the result of the expression 8 + 4 / 2 * 3?

a)

A) 14

b)

B) 20

c)

C) 18

d)

D) 12

42.

What is the correct evaluation order for 10 + 3 * 5 - 2?

a)

A) Addition, Subtraction, Multiplication

b)

B) Multiplication, Addition, Subtraction

c)

C) Subtraction, Addition, Multiplication

d)

D) Parentheses, Multiplication, Addition

43.

Which of the following will evaluate to 20 in the expression 8 + 2 * 3 ** 2?

a)

A) 8 + 9

b)

B) 8 + 12

44.

What is the result of the expression (3 + 2) * (4 - 1)?

a)

15

b)

7

c)

12

d)

9

45.

How does the order of operations in PEMDAS affect expressions with both division and multiplication?

a)

Multiplication is always performed before division.

b)

Division is always performed before multiplication.

c)

Division and multiplication are performed left to right.

d)

Division and multiplication are performed right to left.

46.

What is the result of 10 * (2 + 3) / 5?

a)

5

b)

10

c)

2

d)

20

47.

Which of the following will be evaluated first in the expression 3 + 4 * 2 - 1?

a)

4 * 2

b)

3 + 4

c)

2 - 1

d)

4 * 3

48.

What will be the result of the expression 3 * (2 + 4) ** 2?

a)

3 * 36

b)

3 * 12

c)

3 * 8

49.

If you have the expression 5 + 3 * 2 - (1 + 1), what is the result?

a)

8

b)

9

c)

10

d)

5

50.

What is Programming or Coding?

a)

Writing algorithms to solve a problem on paper.

b)

Finding the best solution to a problem.

c)

Specify the best way to solve a problem.

d)

Writing precise step-by-step instructions to solve a problem using a programming language.