
DCS2103 - Week 13 (Inheritance)
Presentation
•
Computers
•
University
•
Practice Problem
•
Easy
Yasmin Basiran
Used 1+ times
FREE Resource
24 Slides • 13 Questions
1
2
3
Multiple Choice
Which of the following best describes inheritance in object-oriented programming?
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Multiple Choice
In Python, what does the super() function do?
20
Multiple Choice
What is the output of:
class Parent:
def init(self):
self.value = 5
class Child(Parent):
def init(self):
super().__init__()
self.value = 10
c = Child()
print(c.value)
21
Multiple Choice
What is the output of
class A:
def init(self, val):
self.val = val
class B(A):
def init(self):
super().__init__(10)
b = B()
print(b.val)
22
Multiple Choice
Is there an error in this code?
class A:
def init(self):
self.x = 5
class B(A):
def init(self):
self.y = 10
print(B().x)
23
Multiple Choice
If a child class defines its own init but doesn’t call super().__init__(), what happens?
24
25
26
27
28
29
30
Multiple Choice
Which of the following is true about multiple inheritance in Python?
A class can inherit from multiple parent classes
Python does not support multiple inheritance
Only methods are inherited, not attributes
Constructors cannot be inherited
31
Multiple Choice
What is the output of
class Engine:
def init(self, hp):
self.hp = hp
class Car:
def init(self):
self.engine = Engine(150)
c = Car()
print(c.engine.hp)
32
Multiple Choice
What is the main benefit of composition over inheritance?
33
Draw
Draw a multiple inheritance diagram: Bird and Animal as parents, FlyingAnimal as child.
34
Open Ended
Explain composition in Python with a real-life example.
35
Open Ended
What is one concept, function, or trick in Python that you are most proud of learning?
36
Open Ended
What one piece of advice would you give someone taking this course next semester?
37
Show answer
Auto Play
Slide 1 / 37
SLIDE
Similar Resources on Wayground
28 questions
Verbals
Presentation
•
University
28 questions
Session 4: Differentiated instruction and Engagement strategies.
Presentation
•
University - Professi...
30 questions
CUM6010 Activities
Presentation
•
University
32 questions
PREPOSITIONS
Presentation
•
University
33 questions
Roles of Transport Trade Associations and Transport User Bodies
Presentation
•
University
33 questions
Freedom of Expression
Presentation
•
University
32 questions
Hybrid Course Design
Presentation
•
University
33 questions
Lines/Levels & Gradients
Presentation
•
Professional Development
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade
Discover more resources for Computers
20 questions
Disney Trivia
Quiz
•
University
10 questions
Spanish Greetings and Goodbyes!
Presentation
•
6th Grade - University
20 questions
Physical or Chemical Change/Phases
Quiz
•
8th Grade - University
39 questions
Unit 7 Key Terms
Quiz
•
11th Grade - University
25 questions
SER and Subject Pronouns
Quiz
•
8th Grade - University
38 questions
Unit 6 Key Terms
Quiz
•
11th Grade - University
19 questions
Key Concepts in Buddhism
Quiz
•
University
0 questions
Cell Domain Basic Review (Biology)
Quiz
•
University