Q:

What is pass in Python?

0

What is pass in Python?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

The pass is a null operation in python. When it is executed, nothing happens. It is useful as a placeholder when a statement is required syntactically, but no code needs to be executed.

The pass statement is useful when you don’t write the implementation of a function but you want to implement it in the future. for example,

def addNum(num1, num2):
  # Implementation will go here 
  pass # Pass statement
addNum(2, 2)

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now