-2

What does pass mean in python? I have seen it used and I do not see why you need to use it or what it does? I guess I could say it passes over whatever function it is in, but why include it?

TJRelytS
  • 21
  • 4

2 Answers2

4

Quoth the doc:

The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action.

References:

Robᵩ
  • 163,533
  • 20
  • 239
  • 308
1

"It is used when a statement is required syntactically but you do not want any command or code to execute.

The pass statement is a null operation; nothing happens when it executes. The pass is also useful in places where your code will eventually go, but has not been written yet (e.g., in stubs for example):" https://www.tutorialspoint.com/python/python_pass_statement.htm

Ali Ismayilov
  • 1,707
  • 3
  • 22
  • 37