From the course: Python Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Classes and objects

Classes and objects

(upbeat music) - We already talked about a toaster function, but what if we want to make a whole kitchen? A kitchen has many abilities, toast, bake, microwave, wash dishes, and of course, the all-important coffee maker. These various kitchen appliances have settings, the knob on the toaster, the power setting of the microwave. The dishwasher itself has different modes and multiple functions that can apply to dishes. I'm sure we could make a whole bunch of functions and variables, and throw them in a file somewhere. But what if we want two separate kitchens with different abilities and sets of appliances? What if we want to make a whole house with a kitchen, a laundry room, a bathroom? Multiple houses, maybe one with no laundry room that has to outsource its laundry to a laundromat? You can imagine how these systems would lead to dozens or hundreds of functions, thousands of variables, code that gets long and…

Contents