Parho

Class 12 Computer Science · Chapter 3

Chapter 3: Object Oriented Programming Using Python

Class 12 Computer Science notes for the Punjab textbook: the chapter in short, the points to remember, the definitions and the formulas, with questions and tests.

  • 6 definitions
  • 6 key points
  • 2 formulas

Chapter 3

All notes and resources

Pick one; the notes are on this page, the rest open their own page.

SummaryThe chapter in shortWhat the chapter is about, in a few paragraphs.Open Revision6 key pointsThe points to remember before the paper.Open Definitions6 definitionsIn exam wording, numbered for quick revision.Open Formulas2 formulasEvery formula you need for the numericals.Open TestChapter tests4 tests, marked the moment you finish.Open
Coming soonNotes PDFThe whole chapter's notes as a PDF to keep.
Coming soonExercise solutionsThe textbook exercise, solved step by step.
Coming soonShort questionsShort questions with their answers.
Coming soonLong questionsLong questions with full answers.
Coming soonMCQs PDFMultiple-choice questions with the answer key.
Coming soonNumericalsNumerical problems, worked out.

The chapter in short

Object-oriented programming (OOP) organises programs around objects that combine data and behaviour. Python supports OOP with classes.

The chapter covers classes and objects, attributes and methods, constructors, encapsulation, inheritance and polymorphism.

ClassObjectConstructorEncapsulationInheritancePolymorphism

Key points

  • A class is a blueprint; an object is an instance of a class.
  • __init__ is the constructor that sets up a new object.
  • self refers to the current object inside methods.
  • Encapsulation hides internal data behind methods.
  • Inheritance lets a child class reuse and extend a parent class.
  • Polymorphism lets different classes respond to the same method call in their own way.

Definitions

  1. 1

    Class

    A blueprint for creating objects.

  2. 2

    Object

    An instance of a class with its own data.

  3. 3

    Constructor

    A special method that initialises a new object.

  4. 4

    Encapsulation

    Bundling data with methods and restricting direct access.

  5. 5

    Inheritance

    A class acquiring attributes and methods from another class.

  6. 6

    Polymorphism

    The ability of different objects to respond to the same method in different ways.

Formulas

Class

class Student: def __init__(self, name): self.name = name def greet(self): return "Hello " + self.name

Inheritance

class Prefect(Student): pass

Ready to test chapter 3?

Answer the chapter's questions and see your marks the moment you finish.

Take the test

Parho for Android is coming

Join early access and be the first to get the app: tests, notes and solutions on your phone.

FAQ

Questions students ask

What is Class 12 Computer Science chapter 3 about?

Object-oriented programming (OOP) organises programs around objects that combine data and behaviour. Python supports OOP with classes.

Which definitions should I learn?

This chapter has 6 definitions: Class, Object, Constructor, Encapsulation, Inheritance and Polymorphism.

Which formulas are in this chapter?

Class: class Student: def __init__(self, name): self.name = name def greet(self): return "Hello " + self.name; Inheritance: class Prefect(Student): pass.

How do I practise this chapter?

Read the notes, then answer the chapter's questions without looking, and take the chapter test.

Are these notes free?

Yes. Every notes page, its questions with answers and its tests are free, with no account needed.

Notes written by Parho for the Punjab textbook. Spotted a mistake? Tell us.