W3Tutorials.net
Toggle Menu
Home
Online Go Compiler
Tutorials
Javascript Tutorials
Python Tutorials
Go Tutorials
Blog
All Posts
Python OOP Concepts
Test your grasp of classes,inheritance,and polymorphism.
1. What is a class in Python OOP?
A blueprint for creating objects
An instance of a data type
A built-in function
A module
2. Which of the following are core principles of Object-Oriented Programming (OOP)?
Encapsulation
Inheritance
Polymorphism
Iteration
3. Python supports multiple inheritance, where a class can inherit from more than one parent class.
True
False
4. What is the special method in Python used to initialize a new object? (Enter the method name without parentheses)
5. What term refers to an individual object created from a class?
Class
Instance
Method
Attribute
6. Which of these are valid types of methods in a Python class?
Instance method
Class method
Static method
Global method
7. Static methods in Python can access or modify the class's state.
True
False
8. What keyword/function is used to call a parent class's method from a subclass? (e.g., to invoke the parent's __init__ method)
9. Which OOP concept allows a subclass to provide a specific implementation of a method already defined in its parent class?
Inheritance
Polymorphism
Encapsulation
Abstraction
10. In OOP, the practice of restricting access to certain attributes/methods of an object is primarily associated with which concept?
Reset
Answered 0 of 0 — 0 correct