wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PPL (QUIZ 4) Programming Control Structures

Total questions: 30

Worksheet time: 23mins

Name
Class
Date
1.

A programming structure that allows decision-making based on conditions.

(Type your answer in ALL SMALL LETTERS) Do not forget to submit your answer.

(a)  

2.

A programming construct that enables a set of instructions to be executed repeatedly based on a condition.

(Type your answer in ALL SMALL LETTERS) Do not forget to submit your answer.

(a)  

3.

A mechanism that allows a program to handle runtime errors gracefully.

(Type your answer in ALL SMALL LETTERS) Do not forget to submit your answer.

(a)  

4.

The process of determining the value of an expression following precedence rules.

a)

Looping Constructs

b)

Exception Handling

c)

Expression Evaluation

d)

Control Structure

5.

The keyword used in Python to raise an exception manually.

a)

throw

b)

finally

c)

raise

d)

except

6.

Which loop executes at least once before checking the condition?

(Type your answer in ALL SMALL LETTERS) Do not forget to submit your answer.

(a)  

7.

What is the default control structure used in programming?

a)

Selection

b)

Looping

c)

Sequence

d)

Decision

8.

The part of the exception handling mechanism that executes no matter what.

a)

finally

b)

except

c)

throw

d)

raise

9.

Which type of control structure involves loops?

(Type your answer in ALL SMALL LETTERS) Do not forget to submit your answer.

(a)  

10.

Which type of statement allows branching in the flow of execution?

(Type your answer in ALL SMALL LETTERS) Do not forget to submit your answer.

(a)  

11.

Which of the following is NOT a type of control structure?

a)

Sequential

b)

Decision-making

c)

Looping

d)

Recursion

12.

What is the result of the following expression in Python? print(10 + 5 * 2)

a)

30

b)

20

c)

25

d)

15

13.

Which loop is best used when the number of iterations is known?

(Type your answer in ALL SMALL LETTERS) Do not forget to submit your answer.

(a)  

14.

What keyword is used to exit a loop immediately?

(Type your answer in ALL SMALL LETTERS) Do not forget to submit your answer.

(a)  

15.

Which statement is used to skip the current iteration and move to the next one?

a)

break

b)

pass

c)

continue

d)

return

16.

What will be printed by the following Python code? x = 10 if x > 5: print("Greater") else: print("Smaller")

a)

Greater

b)

Smaller

c)

Error

d)

None of the above

17.

What type of error does exception handling prevent?

a)

Syntax Error

b)

Runtime Error

c)

Logical Error

d)

Compilation Error

18.

In Python, how do you handle a division by zero error?

a)

Using a try-except block

b)

Using an if-else statement

c)

Using a for loop

d)

Using a while loop

19.

What does the finally block do in exception handling?

a)

Runs only if an exception occurs

b)

Runs only if no exception occurs

c)

Runs whether or not an exception occurs

d)

Does nothing

20.

What does the pass statement do in Python?

a)

Terminates a loop

b)

Skips a loop iteration

c)

Does nothing and serves as a placeholder

d)

Raises an error

21.

A for loop is typically used when the number of iterations is known beforehand.

a)

TRUE

b)

FALSE

22.

The break statement skips the current iteration and moves to the next one.

a)

TRUE

b)

FALSE

23.

The finally block in exception handling is executed only if an exception occurs.

a)

TRUE

b)

FALSE

24.

Exception handling is used to fix syntax errors in the program.

a)

TRUE

b)

FALSE

25.

A while loop will always execute at least once, even if the condition is false.

a)

TRUE

b)

FALSE

26.

The continue statement is used to exit the loop immediately.

a)

TRUE

b)

FALSE

27.

Exception handling helps prevent runtime errors from crashing the program.

a)

TRUE

b)

FALSE

28.

A try-except block allows a program to recover from certain errors.

a)

TRUE

b)

FALSE

29.

The raise keyword is used to manually trigger an exception.

a)

TRUE

b)

FALSE

30.

In Python, pass is a placeholder that does nothing when executed.

a)

TRUE

b)

FALSE