Which of the following is a default method executed when a new instance of a class is created?
- create()
- init()
- main()
- new()
The 'init()' method, also known as the constructor, is executed automatically when a new instance of a class is created. It initializes object attributes.
Loading...
Related Quiz
- Which built-in function in Python can be used to get the data type of an object?
- A ____ in Python is a collection of key-value pairs, where the keys must be immutable.
- How can you run a specific test method from a test case in unittest?
- The _______ file is required to recognize a directory as a Python package.
- In Python, a ____ is a function that wraps another function, modifying its behavior.