Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Create a class

  • class
  • class
  • name
  • dir

In order to create a class in Python you only need to use the class keyword with a new class-name. Usually the first letter is capitalized.

In such a minimal class that does not do anything yet, Python still requires us to write some code.

class Point:
    pass