KC Knowledge Check

The Knowledge Check is intended to support learning and self-assessment.

The Knowledge Check is not graded.


1️⃣ Multiple Choice

What is a class in object-oriented programming?

A) A template used to create objects

B) An instance of a class

C) A Python function

D) A DataFrame


2️⃣ Multiple Choice

What is an object?

A) An instance of a class

B) A template used to create objects

C) A Python function

D) A list of values


3️⃣ Multiple Choice

Assume:

class Animal:
    def sleep(self):
        print("Sleeping")

What is the name of the method defined in this class?

A) Animal

B) self

C) sleep

D) print


4️⃣ Multiple Choice

Assume:

class Animal:
    pass

class Bird(Animal):
    pass

What does this mean?

A) Bird inherits from Animal

B) Animal inherits from Bird

C) Bird is a list

D) The code contains an error


5️⃣ Multiple Choice

Why is inheritance useful?

A) It allows a subclass to reuse attributes and methods from a parent class.

B) It makes programs run faster.

C) It converts lists into DataFrames.

D) It replaces loops.


Updated: