What are Loops?

A loop in Python is used to run a block of code repeatedly while a specific condition remains true.

Loops help reduce repetitive code and make programs more efficient, such as when printing numbers or processing items in a list.

Types of Loops in Python

  1. for loop – Used to iterate over a sequence (like list, tuple, string, etc.)
  2. while loop – Used to repeat a block of code as long as the given condition is true

Where are Loops Used?

  • Repeating a task multiple times (e.g., printing a message 10 times)
  • Iterating over elements of a collection (list, dictionary, etc.)
  • Automating repetitive logic like calculations, searching, etc.

Note: Loops can be controlled using statements like break, continue, and pass to manage how and when they stop or skip iterations.

Summary

  • Loops are used to repeat a block of code multiple times.
  • Python provides for and while loops.
  • Control statements like break, continue, and pass help manage loop behavior.

Welcome to ShikshaSanchar!

ShikshaSanchar is a simple and helpful learning platform made for students who feel stressed by exams, assignments, or confusing topics. Here, you can study with clarity and confidence.

Here, learning is made simple. Notes are written in easy English, filled with clear theory, code examples, outputs, and real-life explanations — designed especially for students like you who want to understand, not just memorize.

Whether you’re from school, college, or someone learning out of curiosity — this site is for you. We’re here to help you in your exams, daily studies, and even to build a strong base for your future.

Each note on this platform is carefully prepared to suit all levels — beginner to advanced. You’ll find topics explained step by step, just like a good teacher would do in class. And the best part? You can study at your pace, anytime, anywhere.

Happy Learning! – Team ShikshaSanchar