Skip to content
OtisamLMS
Computing

Computing · Quick practice · answer shown after each question

Object-oriented programming

Question 1 of 10

Question 1 of 10

Encapsulation hides an object's internal details.

Question 2 of 10

Question 2 of 10

Polymorphism means a class can have only one method.

Question 3 of 10

Question 3 of 10

What is printed? class Box: def __init__(self, w): self.w = w b = Box(5) print(b.w)

Question 4 of 10

Question 4 of 10

The Python constructor method is named ___.

Question 5 of 10

Question 5 of 10

Explain why getter and setter methods are used instead of changing attributes directly.

Question 6 of 10

Question 6 of 10

The OOP principle of hiding internal data is ___.

Question 7 of 10

Question 7 of 10

Differentiate between a class and an object, using a real-life example.

Question 8 of 10

Question 8 of 10

self is used to refer to the current object in a Python method.

Question 9 of 10

Question 9 of 10

Inheritance allows

Question 10 of 10

Question 10 of 10

An advantage of OOP is that

Questions written by OtisamLMS in the style of the WASSCE. They are not WAEC past questions.