Defining a Class in Python
A class is a blue print of an object. Where the class is the blue print of the house, the object is the actual house built.
Similar to how function definitions begin with a 'def' keyword in Python, class definitions begin with a 'class' keyword.
class MyNewClass:
'''Docstring goes here. I have created a new class'''
pass
- Here we created a class named 'MyNewClass'. Notice we use the CapWords convention since PEP 8 Style Guide for Python Code recommends this for Class names.
- A docstring is not mandatory but highly recommended. It is written so programmers can understand what it does without having to read the details of the implementation.
- The 'pass' keyword is used in Python to indicate that the body of the class was intentionally left blank. This prevents an 'IndentationError' from occurring in the terminal.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Top comments (0)