What is Object-Oriented Programming?

Object-oriented programming is a method of designing programs that groups together data using objects. Each object is part of a class which serves as a blueprint for defining the object. The idea of objects is modelled from objects in real life, so for example, we could have a class named 'vehicle' and objects within this class could be 'car', 'bus' and 'bike'. All of these objects share variables such as 'wheels' but may have different data for these variables e.g. a bike has two wheels and a car has four.

CL

Related Python Mentoring answers

All answers ▸

Write a Python script to take a product name as input and then automatically google search reviews for it and open the top 3 search results in different tabs


How can you take a list of numbers and add 3 to every number in the list using only one line of code?


What would you expect to be the output of the following code snippet: `a = [1, 2, 3]; b = a; b[1] = 4; print(a); print(b);`, and why?


What can be used to iterate through a list in python?