Introduction to Classes in Python

Introduction to Classes in Python


Topics Covered:

  • Defining a Class
  • Creating Instances of a Class
  • Attributes
    • Class Attributes vs. Normal Attributes
  • Methods
    • Static Methods
    • Class Methods
  • Inheritance

What You Will Need

  • Python 2.7, or 3.4+ installed
  • Download the files for this lesson

If you’d like to follow along in IPython Notebook, do the following:

  • Install Jupyter Notebook
  • Run the notebook by typing jupyter notebook into command line.
  • In the web application that opens, navigate to the folder containing the files you downloaded, and open ‘Classes in Python.ipynb’ to follow along.

Otherwise, you can follow along in your favourite IDE or command line.

All the code will be posted to “Classes in Python”, and as a .py file after the lesson.