Batch - DS301222 # What is pass in python?

Pass statement is used when u have created a function or any other code that hasn’t been completed and you want the rest code to work fine without it. At that time you can use pass statement.
example: Using pass inside if statement.

num = 10
if num > 10:
pass

print(“Hello”)

4 Likes

Good one . Add a example with code it will be great @vivek

@vivek
Yes pass is used to do nothing means that part will be stand still and do nothing during execution.

Well explained @vivek

1 Like