Python OOP Course
- 28Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
28 questions
- 1In Python, each data type like string or integer is actually an instance of a_____.
Hint
Think about the keyword that appears when you check the type of any variable.
Answer
class
- 2To create a custom data type in Python, you define a_____.
Hint
Use the keyword followed by the name and a colon.
Answer
class
- 3The syntax to create an instance of a class is_____.
Hint
Think of calling the class name like a function.
Answer
ClassName()
- 4Attributes are assigned to an instance using the_____operator.
Hint
For example,
item1.name = "phone"uses this operator.Answer
dot
- 5The main difference between regular variables and instance attributes is that instance attributes are_____.
Hint
They belong to a specific object, not globally.
Answer
tied to an instance
- 6A function defined inside a class is called a_____.
Hint
It is a function that operates on an instance of the class.
Answer
method
- 7All methods in a class must accept at least one parameter, conventionally named_____, because Python passes the instance itself as the first argument.
Hint
It refers to the current instance.
Answer
self
- 8When you call a method on an instance, Python automatically passes the_____as the first argument.
Hint
The first parameter receives this.
Answer
object itself
- 9The special method that is automatically called when an instance is created is named_____.
Hint
It starts and ends with double underscores.
Answer
init
- 10The_____statement is used to validate that conditions are met, raising an error if not.
Hint
It checks a condition and optionally prints a message.
Answer
assert
- 11Attributes that belong to the class itself and are shared across all instances are called_____.
Hint
They are defined directly inside the class, outside any method.
Answer
class attributes
- 12When accessing an attribute on an instance, Python first looks for it at the_____level.
Hint
If not found there, it then looks at the class level.
Answer
instance
- 13The magic attribute_____returns a dictionary of all instance attributes.
Hint
It gives you a dict view of the object's namespace.
Answer
dict
- 14A method that can be called on the class itself, not on instances, is created with the_____decorator.
Hint
It takes
clsas the first parameter.Answer
@classmethod
- 15A class method receives the_____as its first argument instead of self.
Hint
It is conventionally named cls.
Answer
class
- 16A method that does not receive any implicit first argument and is defined with the_____decorator is called a static method.
Hint
It behaves like a regular function but is namespaced within the class.
Answer
@staticmethod
- 17Static methods do not receive either self or_____as an implicit first parameter.
Hint
They are like regular functions.
Answer
cls
- 18A common use of a class method is to instantiate objects from a structured data file like_____.
Hint
Comma Separated Values format.
Answer
CSV
- 19The mechanism that allows a class to reuse code from another class is called_____.
Hint
It creates a parent-child relationship between classes.
Answer
inheritance
- 20The class that is inherited from is called the_____class.
Hint
Also known as superclass.
Answer
parent
- 21When defining a child class, you specify the parent class in_____after the class name.
Hint
For example:
class Phone(Item):Answer
parentheses
- 22Using_____helps avoid duplicating code from the parent class in child classes.
Hint
It allows you to call parent methods.
Answer
super()
- 23The principle of restricting direct access to an object's attributes is called_____.
Hint
It protects the internal state of an object.
Answer
encapsulation
- 24To make an attribute read-only, you use the_____decorator on a method that returns the attribute.
Hint
This turns a method into a property that can be accessed like an attribute.
Answer
@property
- 25The concept of hiding unnecessary internal details from the user is called_____.
Hint
It reduces complexity for the user.
Answer
abstraction
- 26To create a private method that should not be called from outside the class, you prefix its name with_____.
Hint
The same technique used for private attributes.
Answer
double underscore (__)
- 27The built-in function_____works differently on strings, lists, and other objects, demonstrating polymorphism.
Hint
It returns length or number of items.
Answer
len()
- 28In OOP, the ability of different classes to respond to the same method call in their own way is called_____.
Hint
"Many forms" in Greek.
Answer
polymorphism

Ask anything
We've read this whole study set, so questions about it get the best answers.