Using Pass Statement

Using Pass Statement:
The pass statement tells the Python interpreter to ‘do nothing’.The interpreter simply continues with the program’s execution whenever the pass statement is encountered. This attribute makes it a good placeholder whenever Python syntactically requires a line but the program itself does not require action. It can be very useful when you’re creating a program and you need to focus on specific areas of your code, but still want to reserve some loops or test run the incomplete code.

1.For example of Pass Statement:
for letter in 'Python': 
if letter == 'h':
print 'This is pass block'
print 'Current Letter :', letter
print "bye!"

Current Letter : P
Current Letter : y
Current Letter : t
This is pass block
Current Letter : h
Current Letter : o
Current Letter : n
Translate »