ExamVeda
Login
Home
Introduction to Python
?

What is the main purpose of a loop in Python?

Answer & Solution
Correct Answer: Option C
The main purpose of a loop in Python is to repeat a block of code.
Loops are fundamental control structures in programming languages that allow the execution of a certain block of code repeatedly. In Python, loops such as for loops and while loops enable you to iterate over sequences, perform operations on elements, and execute code multiple times based on specified conditions. This capability is essential for automating repetitive tasks, processing large amounts of data, and implementing algorithms that require repeated execution of certain steps.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.