A Magical Tour Through Object-Oriented Programming in Python • Hogwarts School of Codecraft and Algorithmancy

Here are all the articles in this series on object-oriented programming:

Overview of the series:

  1. In the first year, we discuss the philosophy of OOP. What’s different about it compared to the programming you learnt before it? Why do you need it? Do you always need it use OOP? Year 1 focusses on the OOP mindset

  2. Year 2 starts to define classes, looking at the syntax to create a class and starting to look at some of the obscure syntax we encounter in OOP, such as __init__() and self

  3. We move on to defining methods in Year 3, understanding how they are attributes of an object too. An object has data and the tools to do stuff with that data. The methods are the tools for doing

  4. In Year 4, we continue building classes with more data attributes and methods and we get classes to interact with each other

  5. Year 5 is all about inheritance. We define classes that use other classes as a starting point

  6. In Year 6 we explore special methods. These are the methods that start and end with double underscores. We’ve come across __init__() already, but now we look at a few more

  7. In the final year, we explore a few more topics related to classes, including static methods and class methods. We also wrap up the series