Python The pass Keyword in Class


The pass Statement

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

Example

class Person:
  pass
Try it Yourself »


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