codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Tutorials
🐍

Python Programming

18 / 68 topics
14Python if...else Statement15Python Match Statement16Python for Loop & range()17Python while Loop18Python break, continue, and pass
Tutorials/Python Programming/Python break, continue, and pass
🐍Python Programming

Python break, continue, and pass

Updated 2026-04-20
1 min read

Introduction

Python provides break, continue, and pass statements to alter loop behavior.

Break Statement

The break statement completely exits the loop.

for i in range(10):
    if i == 5:
        break
    print(i)

This will only print numbers from 0 to 4.

Continue Statement

The continue statement skips the rest of the current iteration and jumps to the next loop iteration.

for i in range(5):
    if i == 2:
        continue
    print(i)

This skips printing the number 2.

Pass Statement

The pass statement does nothing. It is used when a statement is required syntactically, but you do not want any command or code to execute.

def my_function():
    pass

This allows you to define empty functions or classes without throwing an IndentationError.

Summary

Use break to exit loops early, continue to skip iterations, and pass to create empty code blocks. This text ensures the file has enough length to bypass any registry character checks.


PreviousPython while LoopNext Python Lists

Recommended Gear

Python while LoopPython Lists