Pass statement

Pass Statement


pass statement in Python programming is a null statement. pass statement when executed by the interpreter it is completely ignored. Nothing happens when pass is executed, it results in no operation.

pass statement can be used in ‘if’ clause as well as within loop construct, when you do not want any statements or commands within that block to be executed.

Syntax:

pass

Example : Program to illustrate the use of pass statement

a=int (input(“Enter any number :”))
if (a==0):
pass
else:
print (“non zero value is accepted”)

Output:

Enter any number :3

non zero value is accepted


Example : Program to illustrate the use of pass statement in for loop

for val in “Computer”:
pass
print (“End of the loop, loop structure will be built in future”)

Output:

End of the loop, loop structure will be built in future.

Python : Pass statement Program List




CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Website development Company in Allahabad