object-oriented programming

A style of programming that bundles data and the functions that work on it into objects built from classes.

In more detail

A class is the blueprint, an object one instance of it, a property the data an object holds and a method a function that belongs to the class. Encapsulation keeps data behind methods, and inheritance lets a subclass reuse and extend its superclass. It carries 34% of the PCAP-31-03 score.

Example

class Stack:
    def __init__(self):
        self.items = []
    def push(self, v):
        self.items.append(v)

Related terms

Taught in

References

Certification courses