A primer on Python classes
While the concept of a class is simple enough on the surface, classes bring with them a number of terms and concepts that confuse many beginners. In this section, we'll discuss the advantages of using classes, explore the different features of classes, and review the syntax for creating classes in Python.
The advantages of using classes
Many beginners and even intermediate Python coders avoid or dismiss the use of classes in Python; unlike functions or variables, classes do not have obvious uses in short, simple scripts. As our application code grows, however, classes become an indispensable tool for organizing our code into manageable units. Let's look at some ways classes can help us build cleaner code.
Classes are an integral part of Python
A class is essentially a blueprint for creating an object. What is an object? In Python, everything is an object: integers, strings, floats, lists, dictionaries, Tkinter widgets, and even...