Font size
WorksheetsInheritance in python
Total questions: 15
Worksheet time: 13mins
How do you say "inheritance" in Chinese?
继承 (jìchéng)
What is inheritance in python?
New class created from an existing class
In (a) programming you write (b) that represent (c) things and situations, and you create (d) based on these classes.
Making an object from a class is called (a) , and you work with (b) of a class.
What is the keyword to create a class in Python?
What is a method in Python?
A function that is part of a class
What is the special method that Python runs automatically whenever we create a new instance of a class?
(a)
Given the class Person in the picture. Create an instance of the class.
(a) (b) (c) ( (d) )
Given the class Person in the picture and the following object:
student_1 = Person('Jay',15,'Male')
Write how you will access the attribute gender.
(a)
Given the class Person in the picture and the following object:
student_1 = Person('Jay',15,'Male')
Write how you will access the attribute name.
(a)
Given the class Person of the picture. And the following instantiation:
students = [Person('Jade',15,'Male')]
How do you call the method describe_self in the first element of the list?
(a)
What is the correct way to use the __init__() method of the parent class?
None of the 3 examples is correct
Can you override a method of the Parent class in Python?
Maybe?
How do you override a method of the Parent class?
What is the self parameter that it is used in the methods of the classes in Python?
It is a reference to the instance of the class itself.
It is a reserved keyword in Python.
It allows us to create multiple instances of a class.
I don't know. Is it a fire bird?
