First page Back Continue Last page Overview Graphics

The pass Statement

While writing a script it often happens, that you don't want to code some part of the script, e.g. the else part of an if loop. You can “mark” it for later completion with the pass statement.

x = 5

if x == 1:

else:

print(x)

File "pass.py", line 6

else:

^

IndentationError: expected an indented block

Solution with pass:

x = 1

if x == 1:

pass

else:

print(x)