Question Detail

COS 102 6 lecture note; fundamentals of programming Objective Question

Question

What is the primary purpose of 'Repetition' statements (loops) in Python?
Options
A To execute a block of code only once.
B To define new variables.
C To repeat a group (block) of programming instructions.
Correct Answer
D To handle errors in the program.
Correct Answer

Option C is the correct answer.

Detailed Explanation

Page 21 states: 'Repetition Statements are used to repent (repeat) a group (block) of programming instruction.'

Hint

Consider the function of 'loops'.

Question Info