Python @ DjangoSpin

Python: Using the pass keyword

Buffer this pageShare on FacebookPrint this pageTweet about this on TwitterShare on Google+Share on LinkedInShare on StumbleUpon
Reading Time: 1 minutes

Using pass keyword in Python

Using pass keyword in Python

Code-blocks in Python are separated by indents and not by curly braces ( {} ). In cases where you don't want to populate the body of a function or a class, you cannot leave it completely empty. In fact, Python won't allow you to leave it fully vacant. For this purpose, Python has the pass keyword. This keyword is convenient to draft a high-level design of a complicated solution. The user can code on the functionality of the function of the later, he can emphasize solely on the structure of the program.

def functionalityOne():
    pass
 
def functionalityTwo():
    pass

See also:

Buffer this pageShare on FacebookPrint this pageTweet about this on TwitterShare on Google+Share on LinkedInShare on StumbleUpon

Leave a Reply