Interactive Course

Object-Oriented Programming in Python

Learn the fundamentals of object-oriented programming: classes, objects, methods, inheritance, polymorphism, and others!

  • 4 hours
  • 14 Videos
  • 48 Exercises
  • 13,677 Participants
  • 3,600 XP

Loved by learners at thousands of top companies:

paypal-grey.svg
dell-grey.svg
t-mobile-grey.svg
ea-grey.svg
siemens-grey.svg
whole-foods-grey.svg

Course Description

Object-oriented programming (OOP) is a powerful programming paradigm that reduces the complexity of systems as is employs heavy re-usability of code. OOP leverages the concept of objects and classes. Objects may contain data (known as attributes, stored as instance or class variables) as well as procedures (defined as methods). Objects are generated from blueprints known as classes, which specify the attributes and methods to be generated at the time of object instantiation. This course introduces the internals of classes and the utilization of objects, as well as important object-oriented programming fundamentals such as inheritance, polymorphism, and composition.

  1. Deep dive into classes and objects

    Here, we dive deep into the internals of classes, instantiation of objects, the initialization method, instance variables, class variables, overriding class variables, and methods.

  2. Inheritance, polymorphism and composition

    In this chapter we cover inheritance, which is when we create a class that employs (or 'inherits') all class variables and methods from a 'parent' class. We also cover polymorphism, which is when multiple classes inherit from a single class. Finally, we cover composition, which is when classes employ specific class functionality from other classes without necessarily inheriting from them.

  1. 1

    Getting ready for object-oriented programming

    Free

    In this chapter we quickly review functions and data structures, as they are building blocks of object-oriented programming. Then we transition into the conceptual definition of objects and classes.

  2. Deep dive into classes and objects

    Here, we dive deep into the internals of classes, instantiation of objects, the initialization method, instance variables, class variables, overriding class variables, and methods.

  3. Fancy classes, fancy objects

    We create fancier classes with sophisticated methods such as importing datasets, getting descriptive statistics, and renaming columns. Also, we cover best practices for creating and documenting classes according to PEP-8.

  4. Inheritance, polymorphism and composition

    In this chapter we cover inheritance, which is when we create a class that employs (or 'inherits') all class variables and methods from a 'parent' class. We also cover polymorphism, which is when multiple classes inherit from a single class. Finally, we cover composition, which is when classes employ specific class functionality from other classes without necessarily inheriting from them.

What do other learners have to say?

Devon

“I've used other sites, but DataCamp's been the one that I've stuck with.”

Devon Edwards Joseph

Lloyd's Banking Group

Louis

“DataCamp is the top resource I recommend for learning data science.”

Louis Maiden

Harvard Business School

Ronbowers

“DataCamp is by far my favorite website to learn from.”

Ronald Bowers

Decision Science Analytics @ USAA

Vicki Boykis
Vicki Boykis

Senior Consultant in Machine Learning and Engineering

Vicki is a senior consultant in machine learning and engineering and works with clients to build holistic data products used for decision-making. She's previously spoken at PyData, taught SQL for GirlDevelopIt, and blogs about data pipelines and open internet. She has an MBA from Temple University in Philadelphia.

See More
Collaborators
  • David Campos

    David Campos

  • Shon Inouye

    Shon Inouye

Icon Icon Icon professional info