Seedha content par jao
🤖 Python Hindi Bot
Namaste! Main Python Hindi Bot hoon 🐍
Python ya AI se related kuch bhi type karke pucho, ya neeche se quick sawaal chuno.
WhatsApp

Stay Connected with PythonHindii

Join our WhatsApp Community to get the latest Python tutorials, coding tips, interview questions, project updates, and learning resources directly on your phone.

Join WhatsApp Community
Python Hindi Logo
Python in Hindi | Programming Education
Python programming tutorial in Hindi banner Python code learning illustration Hindi Python student coding illustration Python data code pattern background

Python Tutorial in HindiiLearn Python Programming for Free

Learn Python from Beginner to Advanced in simple Hindi.

print("Namaste Python!")
# Variable banana
naam = "Ankit"
umar = 25
 
for i in range(3):
  print("Sikho!")
 
# Output:
Sikho! Sikho! Sikho!

Why Students Learn Here

📚

Structured Tutorials

Beginner se Advanced tak step-by-step organized lessons.

💻

Practical Code

Real examples aur hands-on code jo actually samajh aaye.

🧠

Python + AI Path

Ek clear roadmap jo Python se AI tak le jaata hai.

🚀

Projects & Career

Portfolio-ready projects aur interview preparation.

Ye Kaise Kaam Karta Hai

Hindi mein Python, AI aur Data Skills seekhne ka sabse simple tareeka.

📘

Seekhein

Beginner se Advanced tak, best curated tutorials aur guides Hindi mein.

💻

Practice Karein

Real code examples aur mini-projects ke through hands-on practice karein.

💬

Judein

WhatsApp community se judkar apne doubts clear karein, akele nahi seekhenge.

Python to AI Learning Roadmap

Step-by-step learning path from Python basics to AI, Data Science and career-ready projects.

1
🐍

Python Basics

Introduction, Variables, Data Types, Operators, Input & Output, Conditions, Loops, Functions

Start Python →
2
💻

Python Intermediate

Lists, Tuples, Sets, Dictionaries, Strings, Functions, Modules, File Handling, Exception Handling

Continue Python →
3
⚙️

Advanced Python

OOP, Iterators, Generators, Decorators, Regular Expressions, APIs, Automation, Virtual Environments

Learn Advanced Python →
4
🗄️

SQL & Databases

SQL Basics, MySQL, SELECT, INSERT, UPDATE, DELETE, JOIN, GROUP BY, Database Projects

Learn SQL →
5
📊

Data Analytics

NumPy, Pandas, Data Cleaning, Data Visualization, Matplotlib, Exploratory Data Analysis

Learn Data Analytics →
6
🤖

Machine Learning

ML Basics, Supervised & Unsupervised Learning, Regression, Classification, Model Evaluation, Scikit-learn

Learn Machine Learning →
7
🧠

Artificial Intelligence

AI Fundamentals, Generative AI, AI Tools, Prompt Engineering, LLM Concepts, AI Automation

Explore AI →
8
🚀

Projects & Career

Python Projects, AI Projects, Data Projects, Portfolio, GitHub, Interview Preparation, Career Roadmap

Build Your Career →

Python Pass Statement in Hindi – Example, Uses & pass vs break vs continue

Python Pass Statement

Python Pass Statement

if statements, loops, functions, and classes cannot be empty in Python — but sometimes you don't have any code to put inside them yet. Put the pass statement there to avoid getting an error.

The pass Statement

Example

An empty if statement, avoided with pass:

a = 33 b = 200 if b > a: pass
Try it Yourself »

The pass statement is a null operation — nothing happens when it executes. It simply tells Python "leave this block empty for now" and lets the program keep running.

Why Use pass?

The pass statement is useful in several situations:

  • When you're sketching out code structure but haven't implemented the logic yet
  • When Python requires a statement syntactically, but no action is needed
  • As a placeholder for future code during development
  • In empty functions or classes that you plan to fill in later

pass in Development

While building a project, you might sketch out your program's structure before writing the actual logic. pass lets you do this without syntax errors.

Example

Placeholder for future implementation:

age = 20 if age < 18: pass # TODO: Add underage logic later else: print("Access granted")
Try it Yourself »

pass vs Comments

A comment is ignored by Python entirely, but pass is an actual statement that gets executed (even though it does nothing). You need pass wherever Python expects a statement — a comment alone is not enough.

Example

This will cause an error (empty code block):

score = 85 if score > 90: # This is excellent # This will raise an IndentationError
Example

This works correctly with pass:

score = 85 if score > 90: pass # This is excellent print("Score processed")
Try it Yourself »

pass with Multiple Conditions

You can use pass in any branch of an if-elif-else statement.

Example

Using pass in different branches:

value = 50 if value < 0: print("Negative value") elif value == 0: pass # Zero case - no action needed else: print("Positive value")
Try it Yourself »

pass in Other Contexts

While this page focuses on pass with if statements, it works the same way in loops, functions, and classes.

Example

Using pass in a for loop:

for i in range(5): pass print("Loop completed")
Try it Yourself »
Note: Be careful using pass inside a while loop. If the loop's condition never changes, you'll create an infinite loop that never ends.
Example

Using pass in a function:

def calculate_discount(price): pass # TODO: Implement discount logic # Function exists but doesn't do anything yet
Try it Yourself »
Example

Using pass in a class:

class Student: pass print("Student class created")
Try it Yourself »

pass vs break vs continue

Beginners often confuse pass with break and continue — but each does something completely different.

StatementWhat It Does
passDoes nothing — execution simply continues
breakStops the loop completely
continueSkips the current iteration and moves to the next one
Example

Compare all three:

for i in range(3): pass # does nothing, loop finishes normally for i in range(3): break # stops the loop immediately for i in range(3): continue # skips to the next iteration
Try it Yourself »

Exercise ?

What does the pass statement do?

It skips the entire if statement
It's a null operation - nothing happens
It raises an error

FAQ

What is pass in Python?

pass is a null statement — it performs no action when executed.

Does pass stop the program?

No. The program continues normally to the next statement.

Are pass and break the same?

No. pass does nothing, while break terminates the loop.

Are pass and continue the same?

No. continue skips the current iteration, while pass performs no action at all.

Can you use pass inside a function?

Yes. It lets you define the function now, as an empty placeholder, and add the real logic later.

Summary

pass = Do Nothing

pass is a null statement in Python that performs no action. Its main purpose is to keep empty code blocks valid and act as a placeholder for future implementation.

If you're learning Python from scratch, follow the complete step-by-step Python course in Hindi at PythonHindii.in, and practice your code anytime with our Online Python Editor & Compiler.

Related Articles

🧑‍💻 Python Coding Lab Python code likho, run karo aur practice karo — directly browser mein.