Search Header Logo

Python Inheritance

Authored by Amy Austin

Other

12th Grade

Used 71+ times

Python Inheritance
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does inheritance in Python allow us to do?

Define a class that inherits all methods and properties from another class

Delete properties and methods from the parent class

Ensure that a class can only inherit from one parent class

Prevent a class from being inherited

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the parent class also known as?

Child class

Subclass

Base class

Derived class

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used when you do not want to add any properties or methods to a class?

none

continue

break

pass

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What function is called automatically every time the class is being used to create a new object?

__auto__()

__init__()

__new__()

__class__()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the super() function do?

It overrides the methods from the parent class

It makes the child class inherit all the methods and properties from its parent

It returns a list of all inherited methods

It calls the superclass to log an error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you keep the inheritance of the parent's __init__() function?

By calling the parent's __init__() function within the child's __init__() function

By using the super() function

It is not possible to keep the inheritance

Both A and B are correct

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What property was added to the Student class in the example?

graduationdate

graduationyear

yearofstudy

enrollmentyear

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?