Test your knowledge
Test your knowledgeΒΆ
What is a class?
What is an instance (object)?
What is the relationship between class and object?
Consider the class
class Dog(): pass
Which type has
Dog
? Which type hasDog()
?
Which convention holds when naming classes?
How is a class instanced?
How do you access the attributes and methods of an object?
What is a method?
What purpose has
self
?
What is the purpose of
__init__
and when is that method called?
Describe how inheritance prevents repetitions in the code.
Can a subclass overwrite properties or behavior of the parent class? If yes, how?