MCQOPTIONS
Saved Bookmarks
This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your Python knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What is Instantiation in terms of OOP terminology? |
| A. | Deleting an instance of class |
| B. | Modifying an instance of class |
| C. | Copying an instance of class |
| D. | Creating an instance of class |
| Answer» E. | |
| 2. |
Is the following Python code correct? |
| A. | True |
| B. | FalseView Answer |
| Answer» B. FalseView Answer | |
| 3. |
What is getattr() used for? |
| A. | To access the attribute of the object |
| B. | To delete an attribute |
| C. | To check if an attribute exists or not |
| D. | To set an attribute |
| Answer» B. To delete an attribute | |
| 4. |
What is setattr() used for? |
| A. | To access the attribute of the object |
| B. | To set an attribute |
| C. | To check if an attribute exists or not |
| D. | To delete an attribute |
| Answer» C. To check if an attribute exists or not | |
| 5. |
_____ is used to create an object. |
| A. | class |
| B. | constructor |
| C. | User-defined functions |
| D. | In-built functions |
| Answer» C. User-defined functions | |
| 6. |
_____ represents an entity in the real world with its identity and behaviour. |
| A. | A method |
| B. | An object |
| C. | A class |
| D. | An operator |
| Answer» C. A class | |