Python The pass Keyword in If


The pass Statement

if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error.

Example

a = 33
b = 200

if b > a:
  pass
Try it Yourself »


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.