Python Inheritance Quiz
FREE Online Courses: Click for Success, Learn for Free - Start Now!
Quiz Summary
0 of 10 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Results
Results
0 of 10 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- Current
- Review / Skip
- Answered
- Correct
- Incorrect
-
Question 1 of 10
1. Question
The ability of one class to acquire methods and attributes of another class is called ____.
CorrectIncorrect -
Question 2 of 10
2. Question
Which of the following is a type of inheritance?
CorrectIncorrect -
Question 3 of 10
3. Question
Multi-level inheritance represents ____ relationship.
CorrectIncorrect -
Question 4 of 10
4. Question
What type of inheritance has multiple subclasses to a single superclass?
CorrectIncorrect -
Question 5 of 10
5. Question
Which of the following statement(s) is/are true?
Statement 1: Multiple Inheritance allows a class to inherit multiple classes.
Statement 2: A combination of two or more types of inheritance is called Hybrid Inheritance.
CorrectIncorrect -
Question 6 of 10
6. Question
What is the output of the below code?
Code
>>> class Reeta:
>>> name = “Reeta”
>>> blood_group = “B Positive”
>>> class Priyanka(Reeta):
>>> name = “Priyanka”
>>> person = Priyanka()
>>> print(person.name, “-“, person.blood_group)
CorrectIncorrect -
Question 7 of 10
7. Question
Choose the correct type of inheritance used in the below code.
Code
>>> class Company:
>>> employees = 500
>>> class Tech(Company):
>>> pass
>>> class Construction(Company):
>>> pass
CorrectIncorrect -
Question 8 of 10
8. Question
What is the output of the below code?
Code
>>> class Parent:
>>> def name(self):
>>> print(“Parent”)
>>> class Child(Parent):
>>> def name(self):
>>> print(“Child”)
>>> class GrandChild(Child):
>>> pass
>>> person = GrandChild()
>>> person.name()
CorrectIncorrect -
Question 9 of 10
9. Question
What is the output of the below code?
Code
>>> class SuperClass:
>>> __hello = “Hello”
>>> class SubClass(SuperClass):
>>> pass
>>> print(SuperClass.__hello)
CorrectIncorrect -
Question 10 of 10
10. Question
What is the output of the below code?
Code
>>> class Audio:
>>> def use(self):
>>> print(“To listen”)
>>> class Video:
>>> def use(self):
>>> print(“To see”)
>>> class Movie(Audio, Video):
>>> def use(self):
>>> super().use()
>>> m1 = Movie()
>>> m1.use()
CorrectIncorrect