Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only T&Cs apply

Find out more

Introduction to classes

Introduction to classes.
0.1
(dinging) (mouse clicking) When you go to the shops to do your weekly grocery shopping, usually you have a shopping list or at least some idea of what you want to get. These items can then be categorised into the functions they perform, for example, you could at least split items into perishables and non-perishables. After this, you can categorise the items even further. There are perishables that are processed and perishables that are not processed foods. And likewise, in these categories, there are particular attributes that perishable and non-perishable goods have. For example, some non-perishable goods, such as toilet paper are used in the toilet primarily. Dish washing detergent is primarily used in the kitchen.
46.8
This is exactly the same concept that classes try to teach. Classes are essentially a blueprint of a general category of items that can be specified in further detail or separated into subcategories. If you’re trying to solve a problem, it might actually be best to think in classes. For example, for your shopping predicament, you know you need to get several items but you’re not sure in which order you need to get these items as they’re located in separate ends of the store. Splitting these items into their respective classes and subclasses can provide you with the benefit of visiting areas in the shop in a specific order based on the class of the items you wish to buy.
This article is from the free online

Programming Essentials with Python: Matplotlib and Seaborn

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now